Forum: Ruby on Rails :prompt on collection_select worked locally but had to chang

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Scott (Guest)
on 2007-06-07 02:52
(Received via mailing list)
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
Scott (Guest)
on 2007-06-07 10:09
(Received via mailing list)
Anyone?
Mark Reginald J. (Guest)
on 2007-06-07 11:04
(Received via mailing list)
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.
This topic is locked and can not be replied to.