I know this one sounds sooo simple, but it’s been bugging me for hours.
I’ve got an ajax drag and drop add page, adding an item from one list to
another. I’ve got it working to the poing where it loads the action to
do the actual adding to the database but that’s where I hit a wall.
Question: how do I make an association in my habtm join table that joins
an existing category and an existing artist.
Here’s what I’ve got so far:
artwork_id = params[:id].split("_")
artwork = Artwork.find(artwork_id)
category = Category.find(params[:category])
categories << artwork render :partial => "category"
I’m stuck on the categories<< bit, there doesn’t seem to be much
straightforward doco that just spells it out clearly.