Rails 3 route :except options are not working
When i run "rake routes" the resultant list is so long that it takes a while for me to find what i need. I have used the exception clause successfully when the routes were plain vanilly, but in the case below开发者_运维知识库, i have been unable to come up with the right construct to make it work.
resources :answers, :except => [:new, :create, :edit, :update, :show, :destroy] do
collection do
post :update_result
end
collection do
post :calculate_and_save
end
end
The result of "rake routes" continues to produce the new, create, edit, update, show and destroy routes. Can you help?
Thanks.
The two post
calls should be in the same collection
block like so:
collection do
post :update_result
post :calculate_and_save
end
精彩评论