在我的routes.rb中,我有:
resources :countries do
resources :cities
end
但是我只想要:
new: GET /countries/:id/cities/new
create: POST /countries/:id/cities
而不是这7个动作。
我能做什么?
最佳答案
干得好:
resources :cities, :only => [:new, :create]
参考here。
关于ruby-on-rails - 限制资源 Action ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/6082929/