使用邪恶的向导嵌套表单

时间:2013-07-31 19:08:12

标签: ruby-on-rails forms wizard

我在向导中有一个嵌套表单。如何执行更新操作,以便同时更新表。我的表格是:

<%= form_for(@web, url: wizard_path, :method => :put, html: {:class=>"form-horizontal, left"}) do |f| %>
  <%= fields_for resource.role do |rf| %>
    <%= rf.text_field :fname, :class=>"span5", type: "text", placeholder: "First Name", required: "" %>
    </div>
    </div>
    <%= rf.text_field :lname, :class=>"span5", type: "text", placeholder: "Last Name", required: "" %>
    <% end %>
<% end %>

我有resource.role =“用户”。

我的模特是网络和用户。

我尝试过这样做但只有网表更新:

class UserStepsController < ApplicationController
include Wicked::Wizard
steps :personal, :organization

def show
    @web = current_web
    render_wizard
end

def update
    @web = current_web
    @web.attributes = params[:web]
    render_wizard @web
end
end

请帮助

0 个答案:

没有答案