Created
June 14, 2012 13:17
-
-
Save designium/2930247 to your computer and use it in GitHub Desktop.
Nested form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% @product.images.build if @product.images.blank? %> | |
<%= f.simple_fields_for :images do |img| %> | |
<% unless @product.images.first.file.blank? %> | |
<div class="control-group"> | |
<label class="controls"><%= image_tag @product.images.first.file %></label> | |
</div> | |
<%= img.input :_destroy, :label => "Remove", :as => :boolean %> | |
<% end %> | |
<%= img.input :file, :as => :file, :label => "Picture", input_html: { class: "input-hundredpercent" } %> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment