Search code examples
ruby-on-railsruby-on-rails-3seosearch-engine

Rails - How to customize URL instead of showing ID for SEO


I'm working with a Rails application with article resources. Currently, the pages are indexed by Google like this, http://domain.com/article/id. But I know that this is not very descriptive for SEO purposes and I wonder if I can include the title of the article in there.

I'm not sure about the format though. Could I do it like http://domain.com/article/id/title-of-article. Not sure about the standard way to do this. Any ideas would be very helpful. Thanks!


Solution

  • You can use Friendly ID, tutorial is here. Very simple and quite good stuff.

    It lets you to use name or title instead of id in the url.