RailsCasts Pro episodes are now free!

Learn more or hide this

Fun with Find Conditions
Episode #15Apr 06, 200741 comments

Fun with Find Conditions

You can pass more than simple strings to find conditions. Arrays, ranges, and nil values can be passed as well. In this episode you will see the tricks involved with passing these odd objects to find conditions. (Update: audio fixed). (4 minutes)
Performing Calculations on Models
Episode #14Apr 04, 200735 comments

Performing Calculations on Models

Did you know ActiveRecord provides class methods for performing calculations on models? You can even use these methods through associations. (2 minutes)
Dangers of Model in Session
Episode #13Apr 02, 200739 comments

Dangers of Model in Session

Be careful when storing a model in a session. It will behave differently than you expect and can easily get out of sync with the database. Instead of storing the model directly in the session, store the id to the model and use that to fetch it from the database. (5 minutes)
Refactoring User Name Part 3
Episode #12Mar 30, 200764 comments

Refactoring User Name Part 3

In the final part of this series you will see how to refactor your tests. Keeping tests clean is important because it will make testing easier to do in the future. (4 minutes)
Refactoring User Name Part 2
Episode #11Mar 28, 200737 comments

Refactoring User Name Part 2

Testing and refactoring go hand in hand. Refactoring is all about improving code without changing its behavior. Testing is all about making sure you don't change the behavior while you are improving the code. (6 minutes)
Refactoring User Name Part 1
Episode #10Mar 26, 200736 comments

Refactoring User Name Part 1

Learn how to clean up your code through refactoring. This episode will show you how to move code from the view into the model to remove duplication and simplify the view. (5 minutes)
Filtering Sensitive Logs
Episode #9Mar 23, 200740 comments

Filtering Sensitive Logs

Are you accepting sensitive user data? Passwords, credit card numbers, etc. By default, Rails stores all submitted parameters in plain text in the logs. This episode will show you how to filter this sensitive input so it doesn't show up in the log file. (2 minutes)
Layouts and content_for
Episode #8Mar 21, 200745 comments

Layouts and content_for

If you want to change something in the layout on a per-template basis, content_for is your answer! This allows templates to specify view code that can be placed anywhere in a layout. (3 minutes)
All About Layouts
Episode #7Mar 19, 200739 comments

All About Layouts

Everything you wanted to know about layouts: global layouts, controller layouts, shared layouts, dynamic layouts and action layouts. Yes, there really are that many ways to specify a layout. (6 minutes)
Shortcut Blocks with Symbol to_proc
Episode #6Mar 16, 200743 comments

Shortcut Blocks with Symbol to_proc

It may have a goofy syntax, but the Symbol#to_proc feature Rails adds allows you to do simple blocks very quickly and easily. (3 minutes)