Reputation: 7649
I have in my routes.rb file
resources :shops
which I want, since I want to separate index and show routes, but this leads to a /shops/ url
I'd actually like it to make to /shop - what's the easiest way to do this?
Thanks!
Upvotes: 0
Views: 384
Reputation: 4880
If you want them all to be /shop
shop/1
etc. then do:
resources :shops, path: "shop"
Otherwise maybe you can do
resources :shops, except: :show
# then
resources :shops, only: :show, path: "shop"
# or
get "shop/:id", to: "shops#show", as: :shop
Upvotes: 4