Skip to content

Instantly share code, notes, and snippets.

@Nursultan91
Created April 25, 2017 14:50
Show Gist options
  • Save Nursultan91/516e048ef6698ef3558e86f95d3aba7e to your computer and use it in GitHub Desktop.
Save Nursultan91/516e048ef6698ef3558e86f95d3aba7e to your computer and use it in GitHub Desktop.
ActiveAdmin.register Project do
permit_params :name, :content, :price, :image
show do |t|
attributes_table do
row :name
row :content
row :price
row :image do
project.image? ? image_tag(project.image, height: '100') : content_tag(:span, "No photo yet")
end
end
end
form :html => { :enctype => "multipart/form-data" } do |f|
f.inputs do
f.input :name
f.input :content
f.input :price
f.input :image, as: :file, input_html: {multiple: true}
end
f.actions
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment