Displaying 1 result from an estimated 1 matches for "add_artwork".
2006 Jul 11
0
Creating an association in a join table
...king 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:
def add_artwork
##Security Hole???
artwork_id = params[:id].split("_")[1]
artwork = Artwork.find(artwork_id)
category = Category.find(params[:category])
categories << artwork
render :partial => "category"
end
I''m stuck on the categories<< bit...