Skip to content

Instantly share code, notes, and snippets.

@wflanagan
Last active February 20, 2019 18:56
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 wflanagan/5f73eab4dfdd93aadf74d98fa4c62ba5 to your computer and use it in GitHub Desktop.
Save wflanagan/5f73eab4dfdd93aadf74d98fa4c62ba5 to your computer and use it in GitHub Desktop.
ActiveAdmin how to do a simple select dropdown
panel "Send Chat Message" do
form action: "/admin/subscribers/#{resource.id}/send_message", method: :post do |f|
div do
f.select 'Bot', :bot_id, :collection => resource.bots.collect {|bot| [bot.name, bot.id]}
end
div do
f.text_area :text, nil, as: :text, placeholder: 'Enter your text message'
end
div do
f.input :submit, type: :submit
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment