a. Get your DB Access out of the views...

b. Read The Fine Manual on collection_select

c. Controller:

@vendors = TableName.find(:all).uniq  or some variant thereof

With a lot of records, you might want to use a find_by_sql and let the 
DB do the work with a "SELECT DISTINCT..."

d. View:

<%= collection_select("model_to_populate", "column_to_populate", 
@vendors, "id", "vendor_name_field") %>
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to