Form_forで任意のControler, Actionを指定する方法 - 2016chubachi/tabitomo GitHub Wiki

Form_For は送信先のcontrolerとactionを類推していくれるがうまくいかず、以下のようなエラーが時がある

No route matches {:action=>"show", :controller=>"traveler_bookings", :locale=>:ja} missing required keys: [:id]

その場合、以下のような方法でControler, Actionを指定できる

<%= form_for(@booking,url: {controler: "traveler_bookings", action: "create" }, html: { class: "form-horizontal"} ) do |f| %>
  <%= render "form", f: f %>
<% end %>

以下、参考URL

http://blog.livedoor.jp/itukano/archives/51832260.html

http://qiita.com/shunsuke227ono/items/7accec12eef6d89b0aa9

⚠️ **GitHub.com Fallback** ⚠️