Topic: HATBM question...
I'm trying to help a friend with a HABTM question. I've only used HMT so I'm not too upto speed on some of the proper plumbing of HATBM and I would appreciate any advice you can offer.
The current situation, he has a "Question" model class and a "Keyword" model class and we are working on with a keywords_questions join table. Both model classes have the habtm relationship defined.
He's trying to setup the new question creation view and we're trying to figure out the correct stuff to put into the select to properly plumb the system.
He's been trying variations on
collection_select "question", "keyword_ids", @keywords
but there's no "keyword_ids" function defined on the question class. I know in the HMT join models I'm used to you can't streamline the process and you have to loop over the list of things to add (as HMT assumes you have extra attributes on the join, this makes sense). However I would have thought that HABTM would have had some magic to help in this common case. Am I missing something?
I supposed I can help my friend code up keyword_ids= and keyword_ids methods...