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:
Views x
Custom Helper Modules
Rails designates one helper module per controller, but that shouldn't stop you from making custom helper modules to help structure the code. Learn how in this episode.
(5 minutes)
Model Name in URL
By default, Rails uses the model's id in the URL. What if you want to use the name of the model instead? You can change this behavior by overriding the to_param method in the model. Watch this episode for details.
(6 minutes)
Create Model Through Text Field
Let's say you provide a select menu for setting which category a given product belongs to, but you also want the option of creating a new category by typing the name in a text field. See a great way to do that in this episode.
(5 minutes)
Cleaning Up the View
This episode starts off with a big, messy template. Watch as this code shrinks and becomes more readable while the interface stays the same.
(9 minutes)
Update through Checkboxes
See how to select multiple items using checkboxes and perform an action on the selected items in this episode.
(10 minutes)
Blocks in View
If you try to create a helper method which accepts a block, you will run into a few gotchas. Learn the secrets of blocks in views in this episode.
(9 minutes)
Customize Field Error
When a validation error occurs, Rails helpfully wraps the field in a div tag so you can style it. But sometimes you don't want this behavior. In this episode you will see how to customize it.
(3 minutes)
Multibutton Form
If you have a form with multiple buttons, you can detect which button was clicked by checking the passed parameters. Learn how in this episode.
(4 minutes)
Simple Search Form
A search form is quite different than other forms, this is because it does not deal with model's attributes. See a good way to add a simple search form in this episode.
(6 minutes)
Named Routes
When you add a custom route, make it a named route so you have url helper methods to easily link to that new route. See episode for details.
(6 minutes)