On 17.7.2007, at 14.25, Ooze wrote:
Hey guys, i'm new to rails and need some help. I want to create a simple dropdown which gets its values from a model. I found a propably suitable function but I dont quite get how to use it. Here is what i did - and what does not work - but maybe you'll get an idea for what it is meant for: Server: <%= options_from_collection_for_select(@server, "pid", "title", @account.server) %> ... Well 'account' has a column which saves the server_id that correspons to the id from servers table.
<%= select(:account, :server_id, Server.find(:all).collect{ |s| [s.name, s.id] }) %>
(http://api.rubyonrails.org/classes/ActionView/Helpers/ FormOptionsHelper.html#M000506)
This list is for discussing the development of the Rails framework, though. Please use the general Rails mailing list (http:// groups.google.com/group/rubyonrails-talk) for help requests.
//jarkko -- Jarkko Laine http://jlaine.net http://dotherightthing.com http://www.railsecommerce.com http://odesign.fi
smime.p7s
Description: S/MIME cryptographic signature
