# Select option to a select\_tag after submitting form

**URL:** <https://www.ruby-forum.com/t/select-option-to-a-select-tag-after-submitting-form/181947>\
**Category:** Rails\
**Created:** [January 20, 2010, 3:57pm UTC](https://www.ruby-forum.com/t/select-option-to-a-select-tag-after-submitting-form/181947 "2010-01-20T15:57:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dannypotta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@dannypotta](https://www.ruby-forum.com/u/dannypotta)\
**Post date:** [January 20, 2010, 3:57pm UTC](https://www.ruby-forum.com/t/select-option-to-a-select-tag-after-submitting-form/181947/1 "2010-01-20T15:57:01Z")

</div>

How can I keep the selected option in the select\_tag after submitting a  
form to the same page?

Form  
\<%= select\_tag :city\_id,  
options\_from\_collection\_for\_select(City.find(:all), :id, :name) %\>

After submit the page renders and then I want the selected city to be  
displayed in the select\_tag, how can I do this?

All cities Stockholm GÃ¶teborg \<---- for example if this was the choice ...and so on

THANKS!
