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?
You can use path
option of resources
method:
resources :users, path: :people
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With