My favourite Rails references

. 1 min read

In a previous job, my boss had an awesome habit of printing out commands and reference guides, and sticking them on the wall behind his desk.

I love the idea too. I refer to my wall notes almost every day. I know the answers are on Stack Overflow too, but it is so much faster to read my wall.

Here are my two favourite references.

Different Ways to Set Attributes in ActiveRecord

A handy table summarising key ActiveRecord methods for Rails 4 and Rails 5. I refer to this table many times every week.

I use this table to double check:

  • Which update method triggers callbacks?
  • Which update method does not trigger validations?
  • Which update method uses a direct SQL query?

empty? blank? nil?

empty? blank? nil? is a table of slightly different methods to check whether an object exists in Ruby and Rails.

Photo by Alfons Morales on Unsplash.