Rails Fitness Tracker App Part 2: Routes and Views
This is Part 2 of a series of posts about my experience building my first Rails application. Read Part 1 here
At this point of the project, I have successfully pulled off 3rd-party authentication using Devise and OmniAuth!
So now, along with s...
blog.mydevdiary.net
Awesome here. Let me suggest you that instead of
def set_routine @routine = Routine.find_by(id: params[:id]) endYou do something like:
def set_routine @routine = Routine.find(params[:id]) end.find_byreturnsnilwhen it doesn't found nothing and then you could faceNoMethodError for NilClass..findraises an exception and you can better handle that with a notification or message or something.