Didn’t know what else to call this subject, sorry.
Anyway this is more a general discovery question then a coding one.
Is it possible (and I already know it should be) to create forms where
depending on a particular choice in one select tag, one or another
select tags would be presented in the form.
As an example, a shopping site , where a dropdown has options of:
1-Men’s shoes
2-Women’s shoes
3-Children’s shoes
If user selects Men’s shoes, then the following form field / select
would present a set of options for men’s shoes, etc. Similarly, the
other options would generate other select options particular to those
groups (women’s or children’s).
So, while I know this is doable, is it something that requires Ajax or
JS or more native types of calls with Ruby ?
Here’s something I use for presenting a list of countries to the user
and then having a different set of localities (provinces/states/etc)
display depending upon their country choice. This uses a javascript
onchange method with an ajax callback to update the element with the
“locality” id, and in my :change_country action, I render a different
partial template depending upon the user_country parameter. You
should be able to adapt this for what you want to do.