I’m working on a Custom Formbuilder. I want it to create me with a
single method call checkboxes for a given HABTM association.
My model looks like this:
class Member < ActiveRecord::Base
:class_name => 'MusicStyle',
:join_table => 'members_have_preferred_music_styles'
In my view I’d like to do the following:
<%= form.checkboxes :preferred_music_styles %>
The method checkboxes() should now create a set of checkboxes; one for
each music style.
But for doing this I have to get more informations about the
- Does the association exist anyway?
- Is it a HABTM association anyway?
- If so, which class (MusicStyle) does it connect to?
I sadly have no idea how to accomplish this task. I’d be very happy if
some could give me a useful hint where to achieve this information.