Updated sorting for channel's videos on view page

This commit is contained in:
2023-03-04 10:59:30 -05:00
parent 5ed1771b18
commit 9ab06f0e9c
4 changed files with 12 additions and 5 deletions

View File

@ -10,7 +10,7 @@ helpers do
def date_format(date)
dt = date.to_datetime
return dt.strftime('%B %d, %Y @ %I:%M:%S %p %Z')
return dt.strftime('%B %d, %Y, %I:%M:%S %p')
end
def date_format_input(date)

View File

@ -31,10 +31,11 @@ namespace '/channel' do
get '/:channel_id' do
channel = Channel.where(id: params[:channel_id]).first()
puts "#{channel.name}"
channel_videos = channel.videos_dataset.reverse(:updated_at).limit(10).all()
erb :'channel/view', :locals => {
:title => channel.name,
:channel => channel
:channel => channel,
:channel_videos => channel_videos
}
end