Skip to content

Instantly share code, notes, and snippets.

@cgallagher
Created June 13, 2012 10:28
Show Gist options
  • Save cgallagher/2923297 to your computer and use it in GitHub Desktop.
Save cgallagher/2923297 to your computer and use it in GitHub Desktop.
Active Admin Image Upload Form
ActiveAdmin.register Milestone do
scope :all, :default => true
scope :global
scope :user_specific
index do
column :title
column :description
column :required_litres
column :is_active
column :is_global
column :image
default_actions
end
form :html => { :enctype => "multipart/form-data" } do |f|
f.inputs 'Details' do
f.input :title
f.input :description, :as => :text
f.input :required_litres
f.input :is_active
f.input :is_global
end
f.inputs 'Images' do
f.input :image, :label => 'Milestone image'
end
f.buttons
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment