views:

110

answers:

2

I have 2 tables :products and :providers with has_and_belongs_to_many association.

I would like to do this

@list = Product.find( :select => "id,title", :include => { :providers => { :select => "id,title" } } )

How can specify fields for included table? Thx!

A: 

Look at this question. It isn't same question; but it probably has your answer: http://stackoverflow.com/questions/1972640/rails-render-xml-of-a-inner-join

Priyank