RailsCasts Pro episodes are now free!

Learn more or hide this

Using with_scope
Episode #5 – Mar 14, 2007 – 57 comments

Using with_scope

Learn how to use with_scope - a very powerful method which will allow your custom find methods to accept any find options. Just like magic! (2 minutes)
Move Find into Model
Episode #4 – Mar 12, 2007 – 46 comments

Move Find into Model

Move a find into the model to clean up the controllers and remove duplication. Also see how you can call these custom find methods through an association. (2 minutes)
Find Through Association
Episode #3 – Mar 08, 2007 – 45 comments

Find Through Association

No need to pass foreign keys in find conditions, just do the find through a has_many association. (2 minutes)
Dynamic find_by Methods
Episode #2 – Mar 06, 2007 – 47 comments

Dynamic find_by Methods

Shorten simple finds considerably and improve readability by using the dynamic find_all_by and find_by methods. (1 minute)
Caching with Instance Variables
Episode #1 – Mar 04, 2007 – 69 comments

Caching with Instance Variables

Learn a quick way to improve performance. Just store the end result of an expensive command in an instance variable! (2 minutes)