2.使用 text_field :xxx, :num controller里 xxx.update_attributes(params[:xxx])
3.model中定义 accept_nest_attributes :xxx
view中 form里
<% f.field_for :xxx do |xxx| %>
<%= xxx.text_field :num %>
<% end %>
2.使用 text_field :xxx, :num controller里 xxx.update_attributes(params[:xxx])
3.model中定义 accept_nest_attributes :xxx
view中 form里
<% f.field_for :xxx do |xxx| %>
<%= xxx.text_field :num %>
<% end %>