I have a form whereby dropdown 2 is populated as a result of the selection made in another select dropdown 1. If dropdown 1 one had options A, B & C (separate call from the database) if I select A the application will do a GET with A as a variable and populate the dropdown 2 with the returned results.
I was thinking this could be done in a number of ways but have not quite figured out which direction to take. The first approach I was going to take is to perform the calls straight away and add values associated with A, B and C to dropdown 1 so when it is activated the additional values populate dropdown 2. Additionally i was also trying to figure how to fire a HTTP GET call dynamically based on user hitting the first select.
Can anyone give some pointers about how to achieve this.
EDIT
An example of how we perform HTTP gets
def get_call(routePath)
started_at = Time.now
enc_url = URI.encode("#{settings.abacus_service_endpoint}#{routePath}")
uri = URI.parse(enc_url)
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.request_uri, get_header_for_abacus_service)
resp = http.request(req)
logger.bench 'SERVICE - GET', started_at, routePath
return resp if response_ok?(resp)
end