I would like to offer an easy interface for selecting information based on the hierarchy of the information.
In my example the user needs to enter his county.
A county is placed in a state and a state is part of a country. So this is my rails model:
# Country
class Country < ActiveRecord::Base
has_many :states
end
# State
class State < ActiveRecord::Base
belongs_to :country
has_many :counties
end
# County
class County < ActiveRecord::Base
belongs_to :state
end
So in my user interface the user should first select the country, based on the country selection the list of associated states is presented and based on the selected state the list of counties is presented.
Is it possible to create this behaviour with ActiveAdmin