RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: model x
Multitenancy with Scopes
Episode #388Oct 20, 2012120 comments

Multitenancy with Scopes

A multi-tenant application can be difficult to implement because the data for each tenant must be completely separate. Here I show how to do this using subdomains and default scopes in Active Record. (12 minutes)
Multitenancy with PostgreSQL
Episode #389Oct 27, 2012112 comments

Multitenancy with PostgreSQL

PostgreSQL Schemas can help create a multi-tenant app by keeping data separate at the database layer. Integrating with migrations can be tricky though, so watch this episode for the full details. (11 minutes)
STI and Polymorphic Associations
Episode #394Nov 25, 201281 comments

STI and Polymorphic Associations

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. (14 minutes)
Authorization from Scratch Part 2
Episode #386Oct 11, 201297 comments

Authorization from Scratch Part 2

This finishes the series on building authorization from scratch by refactoring the permission logic into a DSL, restricting authorization with attributes, and combining with strong_parameters to protect params. (20 minutes)
Thinking Sphinx (revised)
Episode #120Dec 09, 201144 comments

Thinking Sphinx (revised)

Sphinx is a full-text search engine for use with MySQL or PostgreSQL. Learn how to add Thinking Sphinx by defining an index on your model and searching with various options. (10 minutes)
Session Based Model
Episode #119Jul 21, 200863 comments

Session Based Model

If you have a lot of logic associated with the data inside a session, you'll need some central location to put this logic. See how to create a session based model in this episode. (13 minutes)
Mongoid (revised)
Episode #238Jul 28, 201276 comments

Mongoid (revised)

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. (9 minutes)
Ransack
Episode #370Aug 03, 201293 comments

Ransack

Ransack allows you to easily build complex search forms. It also helps in adding sortable links and building a dynamic advanced search page. (10 minutes)
Simple OmniAuth (revised)
Episode #241Jun 02, 201291 comments

Simple OmniAuth (revised)

OmniAuth makes it easy to do user authentication through a third party provider such as Twitter or Facebook. Learn a simple approach in this episode. (11 minutes)
Backbone on Rails Part 2
Episode #325Feb 13, 2012104 comments

Backbone on Rails Part 2

In the second part of this two part series on Backbone.js, we finish up the Raffler application. Included is how to create entries through a form, respond to events, extract sub-views, pre-populate records, visit routes, and more. (24 minutes)