Sign in through GitHub
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, 20072 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)
Shortcut Blocks with Symbol to_proc
Episode #6Mar 16, 20077 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)
Using with_scope
Episode #5Mar 14, 20077 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 #4Mar 12, 200710 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)