Active Admin - Refresh Second Drop Down Based on First Drop Down, Ruby on Rails

Rails Active Admin - how to set up a form's with a drop down that includes X choices plus a free input

There's nothing in ActiveAdmin (Formtastic) that helps you with that, but a popular option often used with ActiveAdmin is Select2, which might help, see for example Select 2 version 4.0 allow user to enter free text

Create a drop down menu using a Table Attribute in Rails Active Admin

I think you are looking for something as follows:

f.input :membership_code, as: :select, collection: Member.all.map(&:membership_code)

Dynamically-adjusting drop down fields on Active Admin form (rails 3.2)

You'll need to do either a page refresh to update data based on what's selected or (my preference) an AJAX call to update the other dropdown after the first one is selected.

There's a great railscast on doing just this - that would be a great place to start.



Related Topics



Leave a reply



Submit