# Simple Problem

**URL:** <https://www.ruby-forum.com/t/simple-problem/133465>\
**Category:** Rails\
**Created:** [March 31, 2008, 8:16pm UTC](https://www.ruby-forum.com/t/simple-problem/133465 "2008-03-31T20:16:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjglazer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ee59a6/32.png) [@sjglazer](https://www.ruby-forum.com/u/sjglazer)\
**Post date:** [March 31, 2008, 8:16pm UTC](https://www.ruby-forum.com/t/simple-problem/133465/1 "2008-03-31T20:16:47Z")

</div>

Hi there,

I have a simple search application where a user types in there address  
and I return a list. I have a radio button and a drop down where the  
user can narrow down the search. The problem is that after the search  
form is submitted and the page redisplays both the drop down value and  
radio button return to there original values rather then the ones chosen  
by the user. How can I go about keeping these values? Here is my view  
code…

\<%= text\_field\_tag :search, params[:search], :size =\> 50 %\> \<%= collection\_select(:restaurant, :cuisine\_id ,Cuisine.find(:all), :id, :name, :prompt =\> "Don't Care") %\> \<%= submit\_tag "Who Delivers?", :name =\> nil %\> Open Now

Thanks,  
steve

---

<div class="post-metadata">

**Author:** ![sjglazer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ee59a6/32.png) [@sjglazer](https://www.ruby-forum.com/u/sjglazer)\
**Post date:** [March 31, 2008, 9:35pm UTC](https://www.ruby-forum.com/t/simple-problem/133465/2 "2008-03-31T21:35:32Z")

</div>

> ,Cuisine.find(:all), :id, :name, :prompt =\> “Don’t Care”) %\>
> 
> \<%= submit\_tag "Who Delivers?", :name =\> nil %\> Open Now
> 
> \<%= check\_box\_tag ‘checkopen’, 1, params[:checkopen] == ‘1’ %\>
> 
> Something similar for collection\_select…

---

<div class="post-metadata">

**Author:** ![sjglazer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ee59a6/32.png) [@sjglazer](https://www.ruby-forum.com/u/sjglazer)\
**Post date:** [March 31, 2008, 10:04pm UTC](https://www.ruby-forum.com/t/simple-problem/133465/3 "2008-03-31T22:04:02Z")

</div>

Thanks Philip…worked like a charm.

steve

Philip H. wrote:

> > ,Cuisine.find(:all), :id, :name, :prompt =\> “Don’t Care”) %\>
> > 
> > \<%= submit\_tag "Who Delivers?", :name =\> nil %\> Open Now
> > 
> > \<%= check\_box\_tag ‘checkopen’, 1, params[:checkopen] == ‘1’ %\>
> > 
> > Something similar for collection\_select…

---

<div class="post-metadata">

**Author:** ![sjglazer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ee59a6/32.png) [@sjglazer](https://www.ruby-forum.com/u/sjglazer)\
**Post date:** [March 31, 2008, 10:05pm UTC](https://www.ruby-forum.com/t/simple-problem/133465/4 "2008-03-31T22:05:56Z")

</div>

Is there a collection\_select\_tag option? I can’t seem to find it?

steve

Philip H. wrote:

> > ,Cuisine.find(:all), :id, :name, :prompt =\> “Don’t Care”) %\>
> > 
> > \<%= submit\_tag "Who Delivers?", :name =\> nil %\> Open Now
> > 
> > \<%= check\_box\_tag ‘checkopen’, 1, params[:checkopen] == ‘1’ %\>
> > 
> > Something similar for collection\_select…
