RailsCasts Pro episodes are now free!

Learn more or hide this

Model Name in URL

#63 Model Name in URL

Jul 27, 2007 | 6 minutes | Active Record, Views, Routing
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.
  • Download:
  • mp4Full Size H.264 Video (9.28 MB)
  • m4vSmaller H.264 Video (6.21 MB)
  • webmFull Size VP8 Video (21.5 MB)
  • ogvFull Size Theora Video (13.3 MB)