Monday, 15 June 2015

ruby on rails - ActiveAdmin: Select nested Attributes based on the user's previous selection -


I would like to provide an easy interface to select information based on the hierarchy of information.

In my example the user needs to enter his county.

A county is placed in a state and the state is a part of a country. So this is my rail model:

  # country country country < ActiveRecord :: Base has_many: End of states # State class state & lt; ActiveRecord :: Base is_to: Country has_many: counties end # County square county & lt; ActiveRecord :: Base is_to: state end  

Then the user should select the country first in my user interface, the list of related states is presented based on the country and based on selected state The list of counties is presented.

Is it possible to deal with an active admin


No comments:

Post a Comment