I am building an app that involves a calendar. I found that the railscast for building a calendar although dated proved to be very helpful. I have everything up and running I am just trying to allow for the contents on each date to be organized by the datetime and not just the date so they appear in the right chronological order.
My current controller looks like this:
def index
@lessons = Lesson.all
@lesson_by_date = @lessons.group_by { |i| i.lesson_date.to_date }
@date = params[:date] ? Date.parse(params[:date]) : Date.today
end
Any help would be greatly appreciated. Thanks