Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%= nested_form_for [@model1, @model2 :html => { :class => 'form-horizontal' } do |f| %>
- ...
- <div class="control-group">
- <%= f.label :model3_id, :class => 'control-label' %>
- <div class="controls">
- <%= f.select :model3_id, @model1.models3.order(:name).collect { |c| [c.name, c.id]} %><br />
- </div>
- </div>
- <%= f.fields_for :model3 do |model3_form| %>
- <%= model3_form.text_field :name %>
- <%= model3_form.link_to_remove "Remove this model3" %>
- <% end %>
- <p><%= f.link_to_add "Add a model3", :model3 %></p>
- ...
Advertisement
Add Comment
Please, Sign In to add comment