Skip to content

Instantly share code, notes, and snippets.

@cdesch
Created June 18, 2014 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdesch/0af7811ba9247c47ac58 to your computer and use it in GitHub Desktop.
Save cdesch/0af7811ba9247c47ac58 to your computer and use it in GitHub Desktop.
ActiveAdmin.register Event do
index do
column :title
column :short_description
column :event_date
column :published
column :type
column :category
default_actions
end
form do |f|
#Debugging
f.semantic_errors *f.object.errors.keys
f.inputs "Details" do
f.input :title, :required => true
f.input :short_description true
f.input :description, as: :wysihtml5
f.input :event_date
f.input :type, :required => true
f.input :category, :required => true
f.input :published, :label => "Published"
f.input :image
f.input :remote_image_url
f.input :recurring_time,
f.input :recurring_rule, :as=> :select, :input_html => { :class => 'recurring_select'}, :collection => options_for_select([[ "- not recurring -" , "null"],["Set schedule..." , "custom" ]], [ "- not recurring -" , "null"])
end
f.actions
end
controller do
def permitted_params
params.permit event: [:title,:image, :remote_image_url, :description, :short_description, :published, :event_date, :recurring_rule, :type_id, :category_id, :recurring_time ]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment