In my pages_controller.rb:
def home
@date = Lesson.find(params[:created_at])
end
At this point I’m just trying to pull the date to try and visualize before I manipulate anything but when I try to call that @date instance variable in home.html.erb
The error I’m getting is Couldn't find Lesson without an ID but I’m not sure why. Any ideas?
The best solution to such problems – use scopes
in your lesson model add:
there’s also default_scope