:prompt on collection_select worked locally but had to chang


#1

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


#2

Anyone?


#3

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.