views:

29

answers:

1

Hi, I have products, productinfos and infos with categories

In my Info model I have a

named_scope :general 

Which gets all records that belong to the category with the name general.

Then in my view I have a loop going through all categories lets say I then have

asset = 'general'

now I would like to do

@generalinfos = @product.infos."#{asset}"

But this doesn't work. Any ideas, how I could solve this?

+1  A: 

Try

@product.infos.send(asset)
klew