新手问题 form_for 的提交路由修改

yuan_yp · August 22, 2013 · Last by yuan_yp replied at August 22, 2013 · 2115 hits
<%= form_for(@product) do |f| %>
  <% if @product.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@product.errors.count, "error") %> prohibited this product from being saved:</h2>
      <ul>
      <% @product.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>
 <% end %>

上面的代码的 form 路径怎么修改

form_for @product, url:{ conrtoller:xxx, action:xxx} do |f
You need to Sign in before reply, if you don't have an account, please Sign up first.