Weird routing error in Rails 3.0

五迷三道 提交于 2019-12-05 11:51:31
Nazgum

I have noticed this as well, only with the POST method and only when using "member", so same as your example, ie:

resources :forum_posts do
  member do
    post :preview
  end
end

will trigger this, but changing it to GET or using collection both work fine, so seems to be a bug with rails routes; I get around this for now by adding the following just above my resources :forum_posts do line:

match '/forum_posts/:id/preview(.:format)', :to => "forum_posts#preview", :as => :preview_forum_post

then everything continues working; easy temporary fix.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!