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:
rails x
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)
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)
Debugging with ruby-debug
This episode will show you how to debug a rails app using ruby-debug: set a breakpoint, inspect variables, change the code and more.
(8 minutes)
Reading the API
The Rails API docs are very useful but can be difficult to read. This episode will give some tips on reading the docs and mention a few alternative sites for accessing the API. Update: sorry about the broken movie, it should work now.
(6 minutes)
5 View Tips
Here's five quick tips to use in views. Be sure to catch the end of the episode where I reveal an exciting contest!
(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)
Time in Text Field
Although Rails does allow you to edit time attributes with text fields, it's not very flexible. In this episode you will learn how to use a virtual attribute to format the time to your liking.
(5 minutes)
Formatting Time
Learn how to use the trusty strftime method to format a time, and see how Rails allows you to save this format for later use.
(5 minutes)
with_options
Several methods in rails take a hash of options as the last argument. If you are passing the same options to several methods, you can remove this duplication by using with_options. Learn all about it in this episode.
(3 minutes)
The Stack Trace
The stack trace can be a very useful tool when it comes to debugging. Learn the ins and outs of how the stack trace works in this episode. Note: I am using an older version of the Rails bundle here so it might be a little different than yours. The command in the newer version is called Install Plugin and requires you to type textmate_footnotes in the search.
(4 minutes)