For a case where I have models like:
- Coutries
- States
- Cities
- Opinions
I d like to begin with just presenting a user with a dropdown for Coutries.
Once a country is selected, then a States dropdown would appear below Countries.
Once a State is selected, then a Cities dropdown would appear below States.
Once a City is selected, a textboxt appears and the user writes their opinion of the city.
Once text is placed in the textbox, a submit button appears.
Once the user clicks submit I process the form data.
I d like to populate each dropdown from a corresponding table using the previous selection to limit the dropdown items.
I d like the same sort of functionality with checkboxes too.
Basically, I d like to be able to define a cascading form input scheme. I have seen some information on the topic, but nothing that wraps it up tight for Rails 3. For instance:
Rails 3.1 Dependent / Cascading Dropdowns and
Rails 3.1 interdependent select dropdown lists
... seem to offer only partial solutions. I am getting the feeling that I might be missing some fundamental Rails concept and that this (seemingly common) task should be easier. I want to streamline the user input experience. My models have a lot of good default data that I d like to present to the user as they make their input choices. I just can t seem to get it all on one page.
我在寻求“Rails动态形式的投入”时,没有获得我所寻求的搜索结果,“Rails Cascadingdown”搜索帮助了一些人。 “Rails活性形式”使我成为互联网史的一部分。
Can someone guide the way?
感谢!
ADDENDUM
This seems to allude to the trouble I have stumbled upon: http://guides.rubyonrails.org/form_helpers.html#building-complex-forms Perhaps that s my answer?