Forum: Ruby on Rails collection_select broken in 2.1.x?

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.
80fd28df7e67cb73bb134f7e9488e254?d=identicon&s=25 oldhamcr@gmail.com (Guest)
on 2008-11-04 20:26
(Received via mailing list)
Greetings,

Can someone verify for me if collection_select is broken in Rails
2.1.x?  I have an administrative form where an administrator can
update the subscription level of a user. In the partial I say

<%= collection_select(:user, :subscriptiontype_id,
Subscriptiontype.find(:all), :id, :dropdown_description) %>

which is almost verbatim-copied from the documentation

collection_select(:post, :author_id,
Author.find(:all), :id, :name_with_initial, {:prompt => true})

The dropdown shows the proper entries but the current value of
user.subscriptiontype_id is never selected.

Any suggestions?  Thanks.

--cro
80fd28df7e67cb73bb134f7e9488e254?d=identicon&s=25 oldhamcr@gmail.com (Guest)
on 2008-11-04 21:43
(Received via mailing list)
> The dropdown shows the proper entries but the current value of
> user.subscriptiontype_id is never selected.

OK, nevermind, I had created user.subscriptiontype_id with the wrong
type (string).  Fixing this fixed the problem.

--cro
This topic is locked and can not be replied to.