Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Applied Filters: Free Episodes x
Virtual Attributes
Episode #16Apr 09, 200734 comments

Virtual Attributes

Keep your controllers clean and forms flexible by adding virtual attributes to your model. This very powerful technique allows you to create form fields which may not directly relate to the database. (3 minutes)
Fun with Find Conditions
Episode #15Apr 06, 20079 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, 20073 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, 20079 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, 20073 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, 20076 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, 20074 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, 20079 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, 200719 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, 200713 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)