Tutorials





Use to_sql to see what query ActiveRecord will generate
If you’re trying to write a tricky ActiveRecord query that includes joins, complex where clauses, or selecting specific values across tables, it can be hard to remember every part of the ActiveRecord DSL.Is it joins(:orders) or joins(:order)? Shou...


Sharing common code between Rails controllers with Scoped pattern
This particular pattern comes from DHH and Basecamp – a codebase that prides itself of using lots of tiny concerns to share bits of behavior.While the savings of repeating the same before_actions to look up a Channel would be a fine benefit on it’...

