I already have:
resources :users
How can I add a route (for POST only) that will work like:
/users/2343/add_section
Is it possible to add this route inside of the resources users blo开发者_开发知识库ck?
resources :users do
end
Having add_section
there is not very RESTful. Consider having a subresource section
and doing POST "/users/123/sections/"
Something like:
resources :users do
member do
post 'add_section'
end
end
As I answered on your previous question
resources :users do
post :add_section, :on => :member
end
精彩评论