RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: model xFree Episodes xRouting x
Pretty URLs with FriendlyId
Episode #314Jan 09, 201299 comments

Pretty URLs with FriendlyId

If you are tired of model ids in the URL, overriding to_param can only get you so far. The friendly_id plugin can help by making it easy to generate a URL slug and maintain a history. (7 minutes)
Model Name in URL
Episode #63Jul 27, 200760 comments

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)