This might be a simple question but Ive had to work around it in both
Rails and PHP. Wondering if there is a standard way to do this.
I have a form where you have a Department Dropdown and associated
Activities for that Department. When you select a department from the
dropdown, I use ajax to pull the activities for that department and
display it as another drop down. When I submit this form (that
contains other text fields) and if validation fails on that, I would
need to re-display the whole page and also indicate possible errors.
This is all handled by Rails except for fields that I fetched using
ajax (activities in the above example). Because the activities is only
populated when I onchange the department field, the dropdown for
activities is empty when the page is re-displayed.
Ive worked around this by checking for the department_id in the
controller and fetching the activities array during re-display, but as
you can see, this will get complex when you have a few drop downs
where each depend on the one above(for e.g. a Country/State/City/Area
type of dropdown).
Is there a standard pattern for solving this problem?
Thanks
Raja
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---