# Form Posts to different controllers/models based on pull down menu select

**URL:** <https://www.ruby-forum.com/t/form-posts-to-different-controllers-models-based-on-pull-down-menu-select/117912>\
**Category:** Rails\
**Created:** [October 22, 2007, 12:05pm UTC](https://www.ruby-forum.com/t/form-posts-to-different-controllers-models-based-on-pull-down-menu-select/117912 "2007-10-22T12:05:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zippy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/13edae/32.png) [@zippy](https://www.ruby-forum.com/u/zippy)\
**Post date:** [October 22, 2007, 12:05pm UTC](https://www.ruby-forum.com/t/form-posts-to-different-controllers-models-based-on-pull-down-menu-select/117912/1 "2007-10-22T12:05:26Z")

</div>

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.
