watch on iTunes
follow on Twitter
follow on Facebook
subscribe to RSS feed
RailsCasts Pro episodes are now free!
STI and Polymorphic Associations
Nov 25, 2012 | 14 minutes |
Single Table Inheritance (STI) can help organize branching logic into separate classes, but a polymorphic association may be a better fit if there are unique database columns.
Click to Play Video ▶
Project Files in Zip (112 KB)
Full Size H.264 Video (29.5 MB)
Smaller H.264 Video (15.8 MB)
Full Size VP8 Video (19.7 MB)
Full Size Theora Video (33.8 MB)
Next Episode >
< Previous Episode
Jan 27, 2013
Learn how to add fields to a form dynamically using another form, complete with custom field types. It's fieldception!
Dec 31, 2012
Autocomplete Search Terms
Learn how to add autocompletion to a search form and improve performance using Rack middleware, caching and switching from SQL to Redis.
Aug 03, 2012
Ransack allows you to easily build complex search forms. It also helps in adding sortable links and building a dynamic advanced search page.
Jul 28, 2012
Mongoid is a Ruby gem for interacting with MongoDB. Here I show the basics of setting up an app, querying for records, adding embedded associations, overriding the id, and more.
Jul 20, 2012
Virtual Attributes (revised)
Virtual attributes are a clean way to add form fields that do not map directly to the database. Here I show how to handle validations, associations, and more.
©2022 RailsCasts -