# :prompt on collection\_select worked locally but had to chang

**URL:** <https://www.ruby-forum.com/t/prompt-on-collection-select-worked-locally-but-had-to-chang/106170>\
**Category:** Rails\
**Created:** [June 7, 2007, 12:52am UTC](https://www.ruby-forum.com/t/prompt-on-collection-select-worked-locally-but-had-to-chang/106170 "2007-06-07T00:52:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![scott](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3e96dc/32.png) [@scott](https://www.ruby-forum.com/u/scott)\
**Post date:** [June 7, 2007, 12:52am UTC](https://www.ruby-forum.com/t/prompt-on-collection-select-worked-locally-but-had-to-chang/106170/1 "2007-06-07T00:52:09Z")

</div>

This is sort of a strange one.

I had the following abbreviated form:

\<% form\_for :product, :url =\> {:action =\> “preview\_item”, :id =\>  
@product}, :html =\> {:multipart =\> true} do |form| %\>  
form.collection\_select(:department\_id,  
@departments,  
:id, :name,  
{:prompt =\> “select a department”})  
\<%end%\>

This worked fine with locomotive and with the hosted enviroment I was  
working with that used mongrel.

I then moved it to a different hosted env using lighttpd and fastCGI.  
I froze my rails before deploying. When I deployed, I noticed the  
select statement wasn’t being honored. However if I change it to the  
following:

\<% form\_for :product, :url =\> {:action =\> “preview\_item”, :id =\>  
@product}, :html =\> {:multipart =\> true} do |form| %\>  
collection\_select(‘product’, ‘department’,  
@departments,  
:id, :name,  
{:prompt =\> “select a department”})  
\<%end%\>

For some reason, getting rid of the form, adding product and changing  
department\_id to department caused this to work.

Can anyone shed some light on this?

Thanks,

Scott

---

<div class="post-metadata">

**Author:** ![scott](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3e96dc/32.png) [@scott](https://www.ruby-forum.com/u/scott)\
**Post date:** [June 7, 2007, 8:09am UTC](https://www.ruby-forum.com/t/prompt-on-collection-select-worked-locally-but-had-to-chang/106170/2 "2007-06-07T08:09:22Z")

</div>

Anyone?

---

<div class="post-metadata">

**Author:** ![scott](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3e96dc/32.png) [@scott](https://www.ruby-forum.com/u/scott)\
**Post date:** [June 7, 2007, 9:04am UTC](https://www.ruby-forum.com/t/prompt-on-collection-select-worked-locally-but-had-to-chang/106170/3 "2007-06-07T09:04:27Z")

</div>

Scott wrote:

> \<% form\_for :product, :url =\> {:action =\> “preview\_item”, :id =\>  
> @product}, :html =\> {:multipart =\> true} do |form| %\>

Should that be \<% form\_for :product, @product, … ?

–  
We develop, watch us RoR, in numbers too big to ignore.
