Categories
- Active Record
- Active Resource
- Active Support
- Administration
- Ajax
- APIs
- Authentication
- Authorization
- Background Jobs
- Caching
- Code Walkthrough
- Controllers
- Debugging
- Deployment
- eCommerce
- Forms
- Mailing
- Models
- Performance
- Plugins
- Production
- Rack
- Rails 2.0
- Rails 2.1
- Rails 2.2
- Rails 2.3
- Rails 3.0
- Rails 3.1
- Rails 3.2
- Rails 4.0
- Refactoring
- Routing
- Search
- Security
- Testing
- Tools
- Views
Applied Filters:
model x
Dangers of Model in Session
Be careful when storing a model in a session. It will behave differently than you expect and can easily get out of sync with the database. Instead of storing the model directly in the session, store the id to the model and use that to fetch it from the database.
(5 minutes)
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.
(9 minutes)
Simple OmniAuth
Authentication is incredibly simple to add with just OmniAuth if you don't need username/password or multiple authentications per user.
(9 minutes)
Searchlogic
Searchlogic makes searching models easier than ever with its assortment of named scopes. In this episode I show you how to create simple and advanced searches.
(13 minutes)
Mongoid
Mongoid is a polished, high-level Ruby gem for accessing MongoDB. Here I cover installation, adding fields, validations, associations, and keys.
(11 minutes)
Move Find into Model
Move a find into the model to clean up the controllers and remove duplication. Also see how you can call these custom find methods through an association.
(2 minutes)
Performing Calculations on Models
Did you know ActiveRecord provides class methods for performing calculations on models? You can even use these methods through associations.
(2 minutes)
Paperclip
Need to add image attachments to a model? See how with paperclip in this episode.
(7 minutes)
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.
(10 minutes)
Self-Referential Association
Creating a social networking site often requires a self-referential association on the User model to define friends/followers. In this episode I show how to do exactly that.
(14 minutes)