For example,
http://www.quora.com/Is-getting-ripped-worth-it
As you can see, the URL for a question does not have a controller’s name. It is associated with the root URL. How can I do this?
In routes.rb, I tried the following:
match '/:id' => "questions#show"
That works, but new_question or edit_question paths still generate /questions/new(.:format) and /questions/:id/edit(.:format) as URLs.
Are there any elegant solutions for this problem?
There is nothing that prevents you from doing this:
but you’ll have to remove
:resources questionsOne elegant solution is to use the friendly_id gem: https://github.com/norman/friendly_id
You can find similar ones at slugs”>http://www.ruby-toolbox.com/categories/rails_permalinks_slugs