Episode Archive

415 Upgrading to Rails 4
With the release of Rails 4.0.0.rc1 it's time to try it out and report any bugs. Here we walk you through the steps to upgrade a Rails 3.2 application to Rails 4.
412 Fast Rails Commands
Rails commands, such as generators, migrations, and tests, have a tendency to be slow because they need to load the Rails app each time. Here we show three tools to make this faster: Zeus, Spring, and Commands.
409 Active Model Serializers
The ActiveModel::Serializers gem can help you build JSON APIs through serializer objects. This provides a dedicated place to fully customize the JSON output
406 Public Activity
Learn how to easily add a user activity feed using the public_activity gem. Here we show both the default setup using model callbacks and a manual way to trigger activities.
396 Importing CSV and Excel
Allow users to import records into the database by uploading a CSV or Excel document. Here we show how to use Roo to parse these files and present a solution for validations
393 Guest User Record
Instead of presenting a sign up form to the user, consider creating a temporary guest record so the user can try out the application without filling in their information up front. They can then become a permanent member afterwards
390 Turbolinks
Turbolinks can make your Rails app feel faster by using JavaScript to replace the page content when clicking a link. It will be default in new Rails 4.0 applications, but here we show how to use it in Rails 3 and mention some of the gotchas.
387 Cache Digests
The cache_digests gem (also included in Rails 4) will automatically add a digest to the fragment cache key based on the template. If a template changes the cache will auto-expire but there are traps we need to watch out for.
340 DataTables
DataTables makes it easy to convert a plain HTML table into one with pagination, sorting, and searching - all done with JavaScript and jQuery. Here we show how to set this up and use a Rails application as the data source.
338 Globalize3
Rails has great internationalization (I18n) support making it easy to translate static text into other languages, but how do we translate database content? Learn how using Globalize 3 in this episode.
336 Copycopter
Copycopter provides a nice interface that clients can use to edit the text in a Rails application. Learn how to deploy a Copycopter server using Heroku and integrate it in a Rails application through I18n.
334 Compass & CSS Sprites
Compass improves the Sass experience by providing useful mixins, functions, and more. You will also learn how to make CSS sprites with it in this episode.
332 Refinery CMS Basics
If you need to quickly create an informational site that can be easily edited, consider using a content management system. Here we show how to build a site using Refinery CMS.
330 Better SASS With Bourbon
If you are tired of the browser vendor prefixes in CSS, take a look at Bourbon. It provides Sass mixins and functions to make CSS more convenient.
328 Twitter Bootstrap Basics
Twitter Bootstrap can help make beautiful web apps quickly by providing you with useful CSS and JavaScript. Here you will learn how to include it into Rails with the twitter-bootstrap-rails gem.
326 ActiveAttr
ActiveAttr provides what Active Model left out. If you need to create a table-less model with features similar to Active Record, read this episode.
324 Passing Data to JavaScript
There are a variety of ways to pass variables from a Rails application to JavaScript. Here we show three techniques: a script tag, a data attribute, and the Gon gem.
304 OmniAuth Identity
With the release of OmniAuth 1.0 there is a new Identity strategy which allows users to register/login with a password if they don't want to use an external provider.
302 In-place Editing
Edit an attribute in-place without leaving a page using the Best In Place gem. Learn how to add validations and support for various field types.
300 Contributing to Open Source
GitHub makes it easier than ever to contribute to open source with pull requests. Here we show how to submit a pull request to the VCR project.
298 Getting Started With Spree
Spree allows you to quickly turn a Rails project into a full eCommerce application. Here we show how to set it up and configure the look and feel of the store.
296 Mercury Editor
Mercury allows you to edit a section of HTML directly in the web browser through a WISYIWYG editor. Here we show how to integrate Mercury into a Rails app and save the changes back to the database.
294 Playing With PJAX
PJAX allows you to quickly update a section of a page using AJAX with automatic pushState support. Here we show how to use both pjax_rails and rack-pjax gems.
292 Virtual Machines with Vagrant
Vagrant allows you to run your Rails application and all of its dependencies in a portable, sharable environment. Use for development, set it up as a staging server, or experiment with a production setup.
290 SOAP With Savon
Communicating with a SOAP API can be a daunting task. Savon makes this easier by presenting the SOAP API through a Ruby interface.
288 Billing With Stripe
Stripe is a full-stack payment solution with very reasonable pricing and is easy to setup. See how to add it to a Rails application here. Currently only available in the US.
286 Draper
Clean up complex view logic using Draper. This gem provides decorators (much like presenters) which bundles view logic in an object oriented fashion. In this episode we do a step-by-step refactoring of a complex template into a decorator.
285 Spork
Spork improves the loading time of your test suite by starting up your Rails application once in the background. Use it with Guard for the ultimate combo in fast feedback while doing TDD.
284 Active Admin
Active Admin allows you to quickly build an admin interface with just a few commands. Not only does it look great, but it is very customizable as shown in this episode.
283 Authentication With Sorcery
Sorcery is a full-featured, modular solution to authentication which leaves the controller and view layers up to you.
282 Upgrading to Rails 3.1
It is incredibly easy to upgrade to Rails 3.1, but if you want to take advantage of the asset pipeline you will need to put in some extra effort. Have no fear because we walk you through each of the necessary steps in this episode.
281 Foreman
Foreman can help manage multiple processes that your Rails app depends upon when running in development. It also provides an export command to move them into production.
280 Pry With Rails
Pry is an alternative to IRB and sports many great features. Here we show how to integrate it into a Rails app, and how it can aid in debugging.
279 Understanding The Asset Pipeline
The asset pipeline is probably the biggest feature in Rails 3.1, but it can seem like magic at first. Here we dive into how the asset pipeline works.
278 Search With Sunspot
Sunspot makes it easy to do full text searching through Solr. In this episode we show how to search on various attributes and add facets for filtering the search further.
277 Mountable Engines
Engines are receiving a major update in Rails 3.1. You can mount them at any path, embed assets, run generators and more. See how in this episode.
276 Testing Time & Web Requests
It can be difficult to test code that deals with the current time or an external web request. Here we show you how to do both using the Timecop and FakeWeb gems.
275 How I Test
Here we show how we would add tests to the password reset feature created in the previous episode. We use RSpec, Capybara, Factory Girl, and Guard to make request, model, and mailer specs.
274 Remember Me & Reset Password
It is easy to create authentication from scratch, but how do we extend it with more features? Here we add a "remember me" check box and a "forgotten password" link.
273 Geocoder
If you need to work with geographic data, Geocoder is an excellent gem for converting addresses and coordinates, finding nearby locations, determining distances, and more!
272 Markdown with Redcarpet
Redcarpet is an easy-to-use gem which interprets Markdown. In this episode we show how to customize it and add syntax highlighting through Pygments and Albino.
271 Resque
Resque creates background jobs using Redis. It supports multiple queue and comes with an administration interface for monitoring and managing the queues.
270 Authentication in Rails 3.1
Here we show three new features in Rails 3.1 that will help with authentication: easier HTTP Basic, SecurePassword in the database, and forcing SSL.
269 Template Inheritance
In Rails 3.1 the controller inheritance also applies to the view layer. Here I show how to add an application template which is shared by all views, and a lookup path for overriding templates based on the subdomain.
268 SASS Basics
Sass extends CSS with variables, nesting, mixins and more. Here I show how to convert plain CSS to SCSS in a Rails 3.1 app.
267 CoffeeScript Basics
CoffeeScript allows you to write JavaScript in a concise, elegant fashion. In this episode we convert JavaScript code to CoffeeScript in a Rails 3.1 app.
266 HTTP Streaming
HTTP Streaming allows the browser to start processing the HTML response while the Rails app is still processing the rest of the request.
265 Rails 3.1 Overview
This is the first episode in a series covering Rails 3.1. Here we show how to install the beta and show some of the new features.
264 Guard
Guard watches files and runs a command after a file is modified. This allows you to automatically run tests in the background, restart your development server, reload the browser, and more.
263 Client-side Validations
Showing validation errors inline as the user is filling out the form can lead to a better use experience. Learn how to do this using the Client Side Validations gem.
262 Trees With Ancestry
The Ancestry gem works like a tree but also allows us to fetch deeply nested messages in a single query. It provides a method to arrange them after fetching.
261 Testing JavaScript with Jasmine
Are you testing your JavaScript? Learn how to add specs using Jasmine. This episode also covers jQuery integration with jasmine-jquery.
260 Messaging With Faye
Faye is a subscription/publishing server which makes it easy to do push notifications within a Rails app.
259 Decent Exposure
he decent_exposure gem makes it convenient to share controller data with the view through methods instead of instance variables.
258 Token Fields
With the jQuery Tokeninput plugin it is easy to add an autocompleting list of entries for a many-to-many association.
257 Request Specs and Capybara
Request specs in RSpec are a great way to ensure the entire application stack is working properly. Here I also show how to use capybara with integrated JavaScript testing using Selenium.
256 I18n Backends
Internationalization is easy to add in Rails, but the YAML files can be difficult to manage. In this episode I show how to use Redis for managing the translations through a web interface.
255 Undo With PaperTrail
Undo and redo behavior is easy to add with a versioning gem such as Paper Trail. Learn how to add an undo link to any model's flash message.
254 Pagination with Kaminari
If you need pagination in Rails 3 try out Kaminari. It is a clean, flexible solution which uses scopes to flow nicely with Active Record queries.
253 CarrierWave File Uploads
CarrierWave makes it easy and clean to add file uploads to your application. It supports a variety of ORMs, frameworks and image processors.
252 Metrics Metrics Metrics
Metric Fu, Metrical, SimpleCov, Rails Best Practices, and more are covered in this episode on metrics.
251 MetaWhere & MetaSearch
MetaWhere provides a way to do complex find conditions without SQL in Active Record. MetaSearch makes it easy to create search forms with many find options.
250 Authentication from Scratch
Password authentication is not too complicated to make from scratch, it will also help to get a better understanding of how it works.
249 Notifications in Rails 3
Rails 3 comes with instrument support through the ActiveSupport::Notifications class. Call "subscribe" to listen to notifications, and "instrument" to send them.
248 Offline Apps Part 2
Learn how to make a site usable offline with HTML 5 localStorage. This last part of the series covers jquery-tmpl and jquery-offline.
247 Offline Apps Part 1
Learn how to make a site usable offline through an HTML 5 cache manifest. This first part of the series covers rack-offline and problems you may run into.
246 AJAX History State
The new pushState function in JavaScript allows us to change the full URL with AJAX. This means the back button, reloading, and bookmark support can be easily added.
245 New Gem with Bundler
Creating new gems is easy with the `bundle gem` command. In this episode we'll walk you through how this works.
244 Gravatar
Gravatar is a service for providing user avatars. See how easy it is to use in Rails in this episode.
243 Beanstalkd and Stalker
Beanstalk is a fast and easy way to queue background tasks. Stalker provides a nice wrapper interface for creating these jobs.
242 Thor
Thor is an alternative to Rake. It has better support for command line arguments and provides a way to add global scripts.
241 Simple OmniAuth
OmniAuth makes it easy to add authentication if you don't need username/password or multiple authentications per user.
240 Search, Sort, Paginate with AJAX
Many administration pages have search, sorting, and pagination on the index page. See how to add all of this including AJAX.
239 ActiveRecord::Relation Walkthrough
The new Active Record query methods in Rails 3 might seem like magic at first. In this episode we unravel how it works by browsing the Rails 3 source code.
238 Mongoid
Mongoid is a polished, high-level Ruby gem for accessing MongoDB. Here we cover installation, adding fields, validations, associations, and keys.
237 Dynamic attr_accessible
It is important to use attr_accessible for security with mass assignment, but what if you need it to be dynamic based on user permissions? See how in this episode.
236 OmniAuth Part 2
In this episode we continue our look at integrating OmniAuth with devise.This time we show how to set up new users with validations.
235 OmniAuth Part 1
OmniAuth is an easy way to add many different authentication services to your app. In this episode we start integrating it with Devise.
234 Simple Form
Simple Form is a convenient way to generate forms with many options to customize the generated markup.
233 Engage With Devise
Janrain Engage (aka RPX) makes it easy to support many authentication solutions through one service.
232 Routing Walkthrough Part 2
In this episode we continue our look into the Rails 3 router by exploring the Mapper class.
231 Routing Walkthrough
How does routing work internally in Rails 3? In this episode I'll walk you through the Rails code that makes routing possible.
230 Inherited Resources
Inherited Resource simplifies RESTful controllers by providing default actions which can be customized through inheritance.
229 Polling For Changes
If you have frequently changing data on the server side, it's helpful to automatically display this to the user as well. Here I show how to accomplish this with polling in jQuery.
228 Sortable Table Columns
In this episode we show you how to make a table of items sortable by clicking on links in the header cells.
227 Upgrading to Rails 3 Part 3
In this episode we finish up this upgrade series by removing all deprecation warnings and fixing some problems in the view.
226 Upgrading to Rails 3 Part 2
Here we continue upgrading an application to Rails 3 by getting our specs up and running and going through the rails_upgrade plugin.
225 Upgrading to Rails 3 Part 1
In the first part of this series on upgrading a Rails 2 application to Rails 3, we'll start off by setting up Rails 3.0 Release Candidate in a clean environment. The rails_upgrade plugin will then help us determine what needs upgrading.
224 Controllers in Rails 3
This episode covers changes to controllers in Rails 3 including embedded flash notices, permanent cookies and respond_with.
223 Charts
There are a number of JavaScript charting libraries available. In this episode we use Highchart in a Rails application.
222 Rack in Rails 3
The router in Rails 3 is fully compatible with Rack. Learn how to embed Sinatra into an app, handle redirects, and improve on Rails Metal.
221 Subdomains in Rails 3
It is now possible to add subdomains to Rails 3 without the use of additional plugins. Learn how in this episode.
220 PDFkit
Generating PDFs in plain Ruby can be a lot of work. Instead, consider generating PDFs from HTML using PDFKit.
219 Active Model
In Rails 3 the non-database functionality of Active Record is extracted out into Active Model. This allows you to cleanly add validations and other features to tableless models.
218 Making Generators in Rails 3
Generators in Rails 3 have been rewritten to use Thor which means the code used to create a generator is quite different. Here you will learn the new way to make generators in Rails 3.
217 Multistep Forms
In this episode we create a multistep form, or wizard, from scratch.
216 Generators in Rails 3
Generators in Rails 3 have been completely rewritten to be more modular. This allows you to customize any generator to fit your specific preferences.
215 Advanced Queries in Rails 3
Learn some advanced techniques regarding named scopes and get an introduction to Arel in this episode.
214 A/B Testing with A/Bingo
A/B Testing (or Split Testing) is a way to experiment with variations in an application to see the most effective option.
213 Calendars
If dates play an important role in your application, consider adding a date picker or calendar view as shown in this episode.
212 Refactoring & Dynamic Delegator
Learn how to refactor a set of conditional Active Record queries using a Dynamic Delegator.
211 Validations in Rails 3
Rails 3 offers several new additions to validations. Here learn how to make a custom error_messages partial, reflect on validations, and clean up complex validations in a model.
210 Customizing Devise
In this episode we continue looking at devise with a focus on customizing its views, routing and validations.
209 Introducing Devise
Devise is a full-featured authentication solution which handles all of the controller logic and form views for you. Learn how to set it up in this episode.
208 ERB Blocks in Rails 3
Rails 3.0 beta 2 is out and it handles blocks in erb templates differently. Find out how in this episode.
207 Syntax Highighting
Three popular choices for syntax highlighting in Rails applications are discussed in this episode: CodeRay, Ultraviolets and Pygments.
206 Action Mailer in Rails 3
Action Mailer has been rewritten for Rails 3 providing a much cleaner API with its use of the Mail gem.
205 Unobtrusive JavaScript
Rails 3 makes great use of unobtrusive JavaScript, helping keep content and behaviour separate.
204 XSS Protection in Rails 3
In previous versions of Rails it was easy for your application to be vulnerable to cross-site scripting attacks. Rails 3 solves this problem but automatically escaping output.
203 Routing in Rails 3
Rails 3 has a new routing interface. In this episode we show how to translate the old interface into the new one and show some of the new features.
202 Active Record Queries in Rails 3
Rails 3 introduces a new query interface for performing finds in Active Record. See how it works along with the changes in named scopes.
201 Bundler
Bundler is the way to manage gem dependencies in Rails 3.0. Learn how to install gems and lock them down in this episode.
200 Rails 3 Beta and RVM
Get started with the first Rails 3.0 beta and install Ruby 1.9.1 using the Ruby Version Manager, RVM. Also a challenge on giving back to Open Source.
199 Mobile Devices
In this episode we change the look and behavior of a Rails app on mobile devices and use jQTouch to build a native-looking interface.
198 Edit Multiple Individually
se checkboxes to edit multiple records in one form, where each one has an individual set of form fields.
197 Nested Model Form Part 2
Add and remove nested model fields dynamically through JavaScript using either Prototype or jQuery.
196 Nested Model Form Part 1
The accepts_nested_attributes_for method, introduced in Rails 2.3, makes handling multiple models in a form much easier. Find out how to use it in this episode.
195 Favourite Web Apps in 2009
In this episode we show you some of the best web applications o 2009 for Ruby developers.
194 MongoDB and MongoMapper
MongoDB is a document-based database engine. Learn how to use it in Rails application with Mongomapper in this episode.
193 Tableless Model
If you want to create a model without an associated database table all you need to do is define a couple methods in the model.
192 Authorization with CanCan
CanCan is a simple authorization plugin that offers a lot of flexibility. Find out how to use it in this episode.
191 Mechanize
Mechanize extends Nokogiri, allowing you to interact with websites, filling in forms and clicking links.
190 Screen Scraping With Nokogiri
Using Nokogiri and SelectorGadget together makes screen-scraping easy.
189 Embedded Association
In this episode we show you how to embed a one-to-many or many-to-many association in a single integer field.
188 Declarative Authorization
Declarative authorization provides an advanced and powerful solution for role-based authorization
187 Testing Exceptions
Even well tested code can sometimes raise exceptions. In this episode we show you how to be notified about this and how to resolve these errors by making use of integration tests.
186 Pickle With Cucumber
Pickle adds a number of convenient Cucumber steps for generating models. Learn how to use Cucumber's table diffs as well.
185 Formtastic Part 2
In this episode we cover some of Formtastic's more advanced features, including its handling of many-to-many relationships, required fields and styling.
184 Formtastic Part 1
Formtastic provides a concise way to generate form views. In the first part of this two-part series we use it to generate a simple form and a more complex, customised one.
183 Gemcutter & Jeweler
Gemcutter is a new service for hosting Ruby Gems. Jeweler is a gem that provides an automated way to release versions of a gem.
182 Cropping Images
In this episode we create a slick user interface for cropping images using Paperclip and JCrop.
181 Include vs Joins
The find method’s include and joins options can be a little confusing as they are so similar. Find out when to use which one in this episode.
180 Finding Unused CSS
As websites change stylesheets can become filled with unused selectors. The Deadweight gem helps to determine which ones can be removed.
179 Seed Data
Rails 2.3.4 introduces a new convention for creating any seed data that your application needs. This means that you no longer have to put seed data in your migrations.
178 Seven Security Tips
Security is paramount in your Rails applications. Here we show seven commons security flaws from mass assignment to CSRF.
177 Model Versioning
If you need to keep track of the changes to an ActiveRecord model and switch between versions the Vestal Versions gem is well worth considering.
176 Searchlogic
Searchlogic uses named scopes to make searching against models simple. See how to create simple and more complex searches in this episode.
175 AJAX History and Bookmarks
AJAX-enabled sites do not usually play well with bookmarking or the brower's page history. In this episode we fix that with a simple jQuery plugin.
174 Pagination With AJAX
Use jQuery to add unobtrusive JavaScript links to a paginated list.
173 Screen Scraping With ScrAPI
Screen scraping is sometimes the only way to get data from another website. This episode uses scrAPI to fetch prices from another site.
172 Touch and Cache
Rails 2.3.3 has a new feature called 'touch'. In this episode we use it to auto-expire associated caches.
171 Delayed Job
The delayed_job plugin provides an excellent way of getting long running tasks running in the background.
170 OpenID With Authlogic
This episode extends the appication built in episode 160 and shows how to add OpenID support to a Ralis application that uses Authlogic.
169 Dynamic Page Caching
Use a combination of page caching and JavaScript to create a fast cached page that can still be updated dynamically.
168 Feed Parsing
In this episode we use two different techniques to parse an RSS feed with Feedzirra.
167 More on Virtual Attributes
Make use of virtual attributes and callbacks to implement tagging in a blogging application.
166 Metric Fu
Metric Fu is a compliation of tools that help you find the places in your code that need improvement. See what they have to say about the Railscasts codebase.
165 Edit Multiple
Select multiple records with checkboxes and edit them all on one form. Find out how to use virtual attributes to update values relatively.
164 Cron in Ruby
Cron does a great job of handling recurring tasks, but the syntax is a little tricky. This episode shows you how to use Whenever to write cron jobs in Ruby instead.
163 Self Referential Association
In this episode we create a small social networking application and use a self-referential association to link users with their friends.
162 Tree Based Navigation
The acts_as_tree plugin provides a good solution for handling a tree-based navigation. In this episode we build a navigation system with menus, subpages and a breadcrumb control.
161 Three Profiling Tools
Find out what your Rails application is doing under the hood with New Relic RPM, FiveRuns TuneUp and Rack::Bug.
160 Authlogic
Authentication can become very complex. This episode shows how to use Authlogic to handle this complexity while keeping control over what is presented to the user.
159 More on Cucumber
There's more to Cucumber than was shown in episode 155. Learn how to refactor complex scenarios in this episode.
158 Factories Not Fixtures
Fixtures can make tests brittle and difficult to read. A better alternative is to use factories to create the necessary objects.
157 RSpec Matchers and Macros
Improve readability and remove duplication in RSpec by making use of matchers and macros.
156 Webrat
Using Webrat allows you to write integration tests in Ruby, rather than in English as you would with Cucumber.
155 Beginning With Cucumber
Cucumber is a testing framework that lets you develop with Behaviour-Driven Development. We develop a new application using BDD in this episode.
154 Polymorphic Association
Polymorphic associations can be a little tricky to understand. In this episode we'll show you how to create one and use it in controllers and views.
153 PDFs With Prawn
With Prawn and Prawnto you can easily generate PDF files in your Rails application.
152 Rails 2.3 extras
A round of some of the smaller new feaures in Rails 2.3 to finish the short series on Rails 2.3.
151 Rack Middleware
Rack middleware provides a way to filter a request and response in your application. We use it to modify the application's response body.
150 Rails Metal
Rails Metal lets you bypass the normal Rails request process and speed up frequently called requests.
149 Rails Engines
Rails 2.3 has most of the Rails Engine plugin built in. Find out how to embed one application into another.
148 App Templates in Rails 2.3
We often have to go through a number of steps to set up a new Rails application the way we like it. Find out how to automate the process with the new App Templates in Rails 2.3.
147 Sortable Lists
Find out how to create a drag and drop list using prototype and one of Rails’ helper methods.
143 PayPal Security
Find out how to encrypt the data to send to PayPal and verify the authenticity of Instant Payment Notifications.
142 PayPal Notifications
PayPal's Instant Payment Notification can be used to tell your app when an order is processed. See how it can be used to mark a cart as purchased.
141 PayPal Basics
The first of a series about dealing with taking payments on your site. Here we show you how to use PayPal to take payments from your cart.
138 I18n
Internationalization was one of the big additions to Rails 2.2. We'll show you how to start using it in this episode.
136 jQuery
In this episode we recreate the AJAX form submission we did back in episode 43 but with jQuery instead of Prototype and RJS.
135 Making a Gem
Gems are now a more popular way of extending Rails than plugins. In this episode we go through the steps needed to create a basic gem.
134 Paperclip
Paperclip makes it easy to add attachments to a model. Find out how in this episode.
44 Debugging RJS
RJS and AJAX can be difficult to debug, especially when the browser doesn't show an error message. Find out how to trace through your AJAX calls in this episode.
43 AJAX with RJS
Learn how to use RJS to generate JavaScript that will update multiple elements on a page.
33 Making a Plugin
Duplication can often be removed from your Ruby code by making methods dynamically. In this episode we make a plugin to do just that.
32 Time in Text Field
Updating time fields via a series of dropdowns isn't the most elegant way to enter date and time information. Find out how to allow your users to enter dates and time in a text field instead.
31 Formatting Time
Use Ruby's strftime method to format dates and take advantage of Rails DATE_FORMATS hash to store custom date formats.
30 Pretty Page Title
It's easy to avoid giving each page in your Rails applications its own title. Here we'll show you an easy way to do it.
29 group_by Month
The group_by method can be used to group lists of items for display in your Rails apps.
28 In Groups Of
The in_groups_of method makes it easy to render a collection of items in several columns, with one slight catch.
27 Cross-site Scripting
Cross-site scripting is a common security issue. FInd out why it is important to escape any user input that you display in a browser.
26 Hackers Love Mass Assignment
If you're using mass assigment you're giving complete control to your models to your users. Learn how to protect them in this episode.
25 SQL Injection
Attacks via SQL injection are one of the most common ways to attack web applications. Learn how to avoid being a victim of it.
24 The Stack Trace
The stack trace is a useful aid when debugging. Learn how to use it in this episode.
23 Counter Cache Column
Improve performance by caching the record count for a has_many association in a counter cache column.
22 Eager Loading
Improve the performance of your Rails application by reducing the number of database queries. Eager loading makes it easy.
21 Super Simple Authentication
Authentication is the final step of setting up administration on our site. There are many ways to do it, but we've taken a simple approach here.
20 Restricting Access
Learn how to lock your site down and keep the public from accessing the administration features,
19 Where Administration Goes
Part one of a three part series on making an administration system for your site that doesn't require building a whole separate set of pages.
18 Looping Through Flash
Displaying flash messages can be a pain. This episode shows an easy way to display all of your flash messages.
17 HABTM Checkboxes
Create a list of checkboxes for easily managing a HABTM relationship.
16 Virtual Attributes
Keep your forms flexible by adding virtual attributes to your model. This powerful technique allows you to create form fields which may not directly relate to the database.
15 Fun With Find Conditions
You can pass objects other than strings to find conditions, but care must be taken to ensure that the correct SQL is generated.
14 Performing Calculations On Models
ActiveRecord provides class methods for performing calculations on models. See how in this episode.
13 Dangers of Model in Session
Care must be taken when storing a model in a session as it can get out of sync with the database.
12 Refactoring User Name Part 3
In the final part of the episodes on testing and refactoring we'll refactor our test code.
11 Refactoring User Name Part 2
Having moved code from the view to the model in part one, we'll refactor it and write some tests to make sure it all still works as expected.
10 Refactoring User Name Part 1
This episode will show you how to move code from the view into the model to reduce duplication and clean up the view.
Filtering Sensitive Logs
By default, Rails stores sensitive data in its log files. Find out how to filter it out.
Layouts and content_for
content_for allows you to change your layouts on a per-template basis.
All About Layouts
Everything you ever wanted to know about layouts.
Shortcut Blocks with Symbol to_proc
The Symbol#to_proc feature in Rails allows you do do simple blocks quickly and easily.
Using with_scope
Learn how to use with_scope - a very powerful method which will allow your custom find method to acceps any find options.
Move Find Into Model
Clean up your controllers and remove duplication by moving a find into your model. Use an association to call custom find methods.
Find Through Association
Use a has_many association in a find to avoid the need to pass foreign keys.
Dynamic find_by Methods
Shorten simple find and improve readability by using the dynamic find_by and find_all_by methods.
Caching With Instance Variables.
Store the result of an expensive command in an instance variable to improve performance.