Pulling from more then on table to populate a select_box

I have two tables - Hotels and HotelAllBrands - and I need to pull data from both tables to fill in a select_box. Current I am just pulling from one:

<%= select( "hotelmembership", "hotel_id", Hotel.find( :all,    :order=> 'name' ).collect {|h| [h.name, h.id]},    { :include_blank => FALSE }) %>

How do I make the above select also pull from the other table? Thanks,

-S

Hi Shandy,

Shandy Nantz wrote:

I have two tables - Hotels and HotelAllBrands - and I need to pull data from both tables to fill in a select_box. Current I am just pulling from one:

<%= select( "hotelmembership", "hotel_id", Hotel.find( :all,    :order=> 'name' ).collect {|h| [h.name, h.id]},    { :include_blank => FALSE }) %>

How do I make the above select also pull from the other table?

The easiest (and IMHO opinion, the most appropriate MVC) way is to do the finds in your controller, combine the results into a single instance variable, and feed the select with that.

HTH, Bill