# Simple Problem

**URL:** <https://www.ruby-forum.com/t/simple-problem/131821>\
**Category:** Rails\
**Created:** [March 13, 2008, 3:53pm UTC](https://www.ruby-forum.com/t/simple-problem/131821 "2008-03-13T15:53:03Z")\
**Posts on this page:** 3\
**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 13, 2008, 3:53pm UTC](https://www.ruby-forum.com/t/simple-problem/131821/1 "2008-03-13T15:53:03Z")

</div>

Hello There,

I have a minor problem that is driving me a bit crazy and was hoping  
maybe someone can see something I’m not…

In my view I have the following code:

**Choose A Cuisine:** \<%= collection\_select(:restaurant, :cuisine\_id , @cuisine, :id, :name, :prompt =\> 'Any') %\>

Now I am trying to access the selected value in my controller with the  
following code:

@cuisineID = params[:restaurant\_cuisine\_id]

Unfortunately @cuisineID always comes back NIL for some reason. When I  
check the development log I see that the param is actually being set  
properly:

Parameters: {“restaurant”=\>{“cuisine\_id”=\>“8”}, “search”=\>“110 ros  
valley rd, Toronto, On, Canada”, “action”=\>“index”, "…)

If it helps, my view is for an index action and so there is no  
restaurant variable to set in the page. The drop down is part of a  
search.

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 13, 2008, 4:14pm UTC](https://www.ruby-forum.com/t/simple-problem/131821/2 "2008-03-13T16:14:06Z")

</div>

Thorsten M. wrote:

> it’s:  
> params[:restaurant][:cuisine\_id]

Thanks a lot. Appreciate the help!

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 13, 2008, 3:56pm UTC](https://www.ruby-forum.com/t/simple-problem/131821/3 "2008-03-13T15:56:24Z")

</div>

it’s:  
params[:restaurant][:cuisine\_id]
