RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: model x
Polymorphic Association (revised)
Episode #154May 19, 201299 comments

Polymorphic Association (revised)

A polymorphic association allows a model to belong_to different types of other models. Here I show how to make a single comment model belong to articles, photos, and events. (11 minutes)
Backbone on Rails Part 1
Episode #323Feb 08, 2012207 comments

Backbone on Rails Part 1

In this first part of a two part series you will learn basic Backbone concepts including models, collections, routers, views and events. The backbone-on-rails gem is used for Rails integration with the asset pipeline. (18 minutes)
Charts & Graphs (revised)
Episode #223Sep 15, 2012116 comments

Charts & Graphs (revised)

If you have a lot of data, consider adding a graph to provide an overview of it. Here I show how to use Morris.js to chart an Order model and visualize trends in the data. (12 minutes)
Tableless Model
Episode #193Dec 21, 200955 comments

Tableless Model

If you want to create a model without a database backend, you simply need to define a couple methods in the model like I show in this episode. (8 minutes)
Fast Tests
Episode #413Apr 10, 2013200 comments

Fast Tests

A slow test suite can put a damper on test-driven development. In this episode I show a variety of ways to optimize specs including: selective testing, preloading Rails, and testing outside of Rails. (17 minutes)
Fast Rails Commands
Episode #412Apr 04, 2013179 comments

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 I show three tools to make this faster: Zeus, Spring, and Commands. (8 minutes)
Hstore
Episode #345Apr 24, 201299 comments

Hstore

With hstore you can add schema-less data to PostgreSQL. This allows you to store model attributes without creating separate database columns. Watch how to do this using the activerecord-postgres-hstore gem. (10 minutes)
ActiveAttr
Episode #326Feb 21, 201254 comments

ActiveAttr

ActiveAttr provides what Active Model left out. If you need to create a table-less model with features similar to Active Record, watch this episode. (5 minutes)
Ember Part 2
Episode #410Mar 12, 2013140 comments

Ember Part 2

Here we continue our look into Ember.js. First we add a JSON API to persist the entries through ember-data. Then we finish up the project by adding a computed property and a view object. (14 minutes)
Devise (revised)
Episode #209Jul 06, 201275 comments

Devise (revised)

Devise is one of the most popular authentication plugins for Rails. Here I show how to set it up with a User model and configure the modules, views, routes, and more. (8 minutes)