homeASCIIcasts

Episode Archive

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.