【发布时间】:2016-05-03 18:12:55
【问题描述】:
当我使用 get_quote 时,为什么表单在寻找 get_quotes 路径?如何更正错误?
耙子路线
get_quote_index GET /get_quote(.:format) get_quote#index
错误:
undefined method `get_quotes_path'
代码:
<%= form_for( @get_quote ,:html => {:class => "form-horizontal"}) do |f| %>
【问题讨论】:
-
您能否发布运行
rake routes CONTROLLER=get_quote时获得的全部结果?答案可能就在其中。 -
我认为,您没有将 get_quote_index 定义为 POST。
-
什么是get_quote?它是一个未保存的活动记录对象吗?
-
问题在于命名约定。谢谢!
标签: ruby-on-rails ruby-on-rails-4 routes form-for