Guest User

model2 form updated

a guest
Jan 28th, 2013
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.58 KB | None | 0 0
  1.     <%= nested_form_for [@model1, @model2 :html => { :class => 'form-horizontal' } do |f| %>
  2.     ...
  3.       <div class="control-group">
  4.         <%= f.label :model3_id, :class => 'control-label' %>
  5.         <div class="controls">
  6.           <%= f.select :model3_id, @model1.models3.order(:name).collect { |c| [c.name, c.id]} %><br />
  7.         </div>
  8.       </div>
  9.  
  10.   <%= f.fields_for :model3 do |model3_form| %>
  11.     <%= model3_form.text_field :name %>
  12.     <%= model3_form.link_to_remove "Remove this model3" %>
  13.   <% end %>
  14.   <p><%= f.link_to_add "Add a model3", :model3 %></p>
  15.  
  16.     ...
Advertisement
Add Comment
Please, Sign In to add comment