I need just simplify url in my rails app.
/nature instead /categories/nature
My routes.rb:
match 'categories/:id' => 'categories#show'
match ':id' => 'categories#show'
This will make any request to '/something' to categories controller with show action though so you have to take that into account.
If I were you I'd do it more like that:
match ':id' => 'categories#show',:constraints => { :id => /nature|sports|architecture|people|.../ }
This way you can still use '/something' routes as you wish as long they don't match any of the available categories.
link_to in my view(it was like this "/category/#{c.id}")