I''ve got a fairly basic has_and_belongs_to_many setup, with a Business
model and a Category model. In the admin functionality for the Business,
I''d like to have a multiple select box showing all of the Categories,
with
included ones selected, etc.
I''m stumped as to how to do it, though - it seems like there should be
an
easy way, but I''m missing it looking over the docs. I can''t
do the
canonical:
select("business", "category_id",
Category.find_all.collect {|c| [c.name, c.id ] }, { :include_blank => true })
Because there''s no business.category_id due to the HABTM.
What''s the standard way to accomplish this?
Thanks,
Wade