Reputation: 34113
In routes.rb
, I currently have resources :users
for the User
controller.
A visitor can request the User
model by www.mydomain.com/users
I would like to keep the User controller as it is, but have the URL request for people
instead, such that a visitor sees the following URL: www.mydomain.com/people
For a single request I can do this by:
get '/users', to: 'users#index'
Is the same possible for for a resource map?
Upvotes: 11
Views: 7507
Reputation: 51191
You can use path
option of resources
method:
resources :users, path: :people
Upvotes: 36