我有一条地址路线:
namespace :carts do
resources :address
然而,它会为新路径addres
生成拼写错误。这是Rails 3.2.14中的错误吗?
carts_address GET /carts/address(.:format) refinery/carts/address#index
POST /carts/address(.:format) refinery/carts/address#create
new_carts_addres GET /carts/address/new(.:format) refinery/carts/address#new
edit_carts_addres GET /carts/address/:id/edit(.:format) refinery/carts/address#edit
carts_addres GET /carts/address/:id(.:format) refinery/carts/address#show
答案 0 :(得分:2)
您必须根据您的控制器名称命名您的路线。并且它们都必须是复数形式
因此,正确的地址路由是:resources :addresses
,知道您的控制器必须是AddressesController