Developer and Writer
I'm a life-long, self-directed learner with a love for libraries, documentation, and all things tech. Currently serving the people at the Carnegie Library of Pittsburgh π Formerly @ CodΓ©dex πΎ and Codecademy π§π»βπ» Extracurriculars (in no particular order): π§π»βπ³ Cooking π Reading (mostly non-fic of all kinds) πΈ Listening to/playing music ποΈ Enjoying awesome podcasts. ππ» Running, walking, moving in general! :D Thanks for reading!
Markdown supported Β· ββ΅ to post
Francisco Quintero
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.