I have a model stories in Rails 3.
I want to make an alias \"books\" for \"stories\" so I can have routes /books/192
instead of /stories/192
resources :stories, :path => :books
If you want to rename the path AND helper methods, then you do:
resources :stories, :path => :books, :as => :books
See: Overriding the Named Helpers
That's why they made the path
option on match
which is also available on resources
:
resources :stories, :path => "books"
Try something like this:
match 'books/:id' => 'books#show'
match 'books' => 'books#index'