开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜