Is there a quick and easy method/library to replace an ActiveAdmin resource's belongs_to association (Formtastic) input that meets these requirements?
:name
and :id
into the dropdown. I would hope that the resulting code would look like:
# in app/models/my_resource.rb
class MyResource
belongs_to :user
end
# in app/admin/my_resource.rb
form do |f|
f.inputs 'Details' do
f.input :user, as: :something_convenient, plus_optional: :parameters_if_needed
end
f.actions
end
The thing you are looking for is chosen-rails gem.
Some time ago I've answered few questions on the topic, so not to repeat stuff please see them for more details:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.