shared items

Sunday, May 3, 2009

What you do is create a select tag with the “select” method like so: (using the client/project scenario),

The next value you pass to the select method has to be an array of text/value pairs

like this: [ [ "Jason Johnson", 1], ["Trey Piepmeier", 2], ["Royall", 3] ]

In order to create this array, you do a find on your clients table and use Ruby’s “collect” method.

like so:

Client.find(:all).collect {|c| [, ]}

So, altogether now:, Client.find(:all).collect {|c| [, ] })


No comments: