0
我在我的routes.rb文件制作多个导轨“资源”链接到奇异
resources :shops
,我想,因为我想单独的索引和显示的路线,但是这会导致A /店/ url
我真的很喜欢它/购物 - 最简单的方法是什么?
谢谢!
我在我的routes.rb文件制作多个导轨“资源”链接到奇异
resources :shops
,我想,因为我想单独的索引和显示的路线,但是这会导致A /店/ url
我真的很喜欢它/购物 - 最简单的方法是什么?
谢谢!
如果你希望它们都成为/shop
shop/1
等,然后做:
resources :shops, path: "shop"
否则也许你可以做
resources :shops, except: :show
# then
resources :shops, only: :show, path: "shop"
# or
get "shop/:id", to: "shops#show", as: :shop