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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs