find_by() & find()

find_by() returns a single instance, not an array.Movie.find_by(id:3).title will return the title of the movie with id 3. if the id doesnt exist, it returns "nil".find() also returns a single instance...
0 Read More

Week 1

Things that would be nice to remember:Change all instance ctrl + F2Route Helper Methods: At the bash prompt, run "rails routes" or navigate to "/rails/info/routes" in live appmethods "live" in control...
0 Read More

belongs_to default

In standard Rails applications, the default is opposite: belongs_to adds an automatic validation to foreign key columns enforcing the presence of a valid value unless you explicitly add the option opt...
0 Read More