繁体   English   中英

Rails 3路由

[英]Rails 3 routing

resources :users do
  get :save_delete, :on => :member
  get :question_form, :on => :member
  post :question_send, :on => :member
  resources :comments
end

发送并POST到服务器后,我在日志中收到此错误:

#Started POST "/users/1/question_send"
#ActionController::RoutingError (No route matches "/users/1/question_send")

rake routes # works fine, no errors

您很可能尚未重新启动服务器。 路由代码看起来不错。

但是,我同意@mathepic-您的资源似乎很奇怪。 也许有些事情我们不知道,但是除非您真的有很好的理由来考虑使用question_formquestion_send成员路由,否则您可能应该考虑采用其他(以及更多Rails-y)方法。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM