Created
March 6, 2012 22:55
-
-
Save orlando/1989583 to your computer and use it in GitHub Desktop.
active admin handle many assets
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
f.inputs "Product images" do | |
f.has_many :assets do |p| | |
p.input :asset, :as => :file, :label => "Image",:hint => p.object.asset.nil? ? p.template.content_tag(:span, "No Image Yet") : p.template.image_tag(p.object.asset.url(:thumb)) | |
p.input :_destroy, :as=>:boolean, :required => false, :label => 'Remove image' | |
end | |
end | |
f.inputs "Product details" do | |
f.input :category, :label => "Category", :hint => "Select one category" | |
f.input :height | |
f.input :width | |
f.input :depth | |
f.input :color, :label => "Color", :hint => "Select one color" | |
f.input :sku, :label => "SKU" | |
f.input :price | |
end | |
f.buttons |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment