Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best Permalinking for Rails

What do you think is the best way to create SEO friendly URLs (dynamically) in Rails?

like image 852
Devar-TTY Avatar asked Dec 09 '22 23:12

Devar-TTY


1 Answers

Override the to_param method in your model classes so that the default numeric ID is replaced with a meaningful string. For example, this very question uses best-permalinking-for-rails in the URL.

Ryan Bates has a Railscast on this topic.

like image 115
John Topley Avatar answered Jan 01 '23 07:01

John Topley