Anyone? If I change the to_user_id in user_id it works. But that
requires a change in the database and makes the whole just less
readable. Especially because there’s another field called
from_user_id.
Ahh… got it. This worked:
<%= collection_select(“deposit”, “to_user_id”, User.find_all, “id”,
“fullname”, :selected => “to_user_id”) %>
But now :prompt does not work anymore…
<%= collection_select(“deposit”, “to_user_id”, User.find_all, “id”,
“fullname”, :selected => “to_user_id”, :prompt => “This is a test”)
%>
Ah…
This works:
<%= collection_select(“deposit”, “to_user_id”, User.find_all, “id”,
“fullname”, {:prompt => ‘Dit is een test’} ) %>
if to_user_id would not be “0”. It’s an integer and probably it’s zero
to default. Can I change this behaviour? Else the selectlist won’t
work. And setting it to ‘’ before each selectlist seems like a crappy
solution.