RailsCasts Pro episodes are now free!

Learn more or hide this

Model Name in URL (revised)

#63 Model Name in URL (revised)

Dec 16, 2012 | 9 minutes | Active Record, Routing
A model's ID in the URL is not very helpful to the user. Consider adding the name which can also improve SEO. Learn how to override to_param, add a slug attribute, and make a catch all route for deep nesting.
  • Download:
  • source codeProject Files in Zip (79.4 KB)
  • mp4Full Size H.264 Video (15.9 MB)
  • m4vSmaller H.264 Video (9.32 MB)
  • webmFull Size VP8 Video (12.2 MB)
  • ogvFull Size Theora Video (18.4 MB)