Zippy
2007-Oct-22 09:54 UTC
Form Posts to different controllers/models based on pull down menu select
Hi there, I just joined your group and was wondering if someone could please help me with this problem. I''m fairly new to ROR and have been trying to figure out how to POST form data to a different controller/model based on a selection from a pull down menu. My form consists of a State pull down menu, a pull down menu consisting of city, zip code, area code options, and a text field. My database has tables cities, zips, areas. Each table has columns state, link_hash, and type respective to table ie. zip What I am trying to accomplish is to post the state and text entered to the selected controller/model ie. drop down menu select city posts to CityController, validation in City model, return link_hash based on selection match. What could I do to make the city, zip code, area code selections point to a different controller? How can I get an error message to pass back to my view if validation fails? How can I get my link_hash passed back to my view? Any help to understanding how these MVC principles work would be appreciated. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---