im trying to create a relationship between products and their
categories. There is a :through join table called classifications.
eg
categories - classifications - products
from the products page i would like to access the destroy and create
methods of the classifications controller to ‘add products to a
category’.
I am able to access the destroy method through the :method => delete
eg
link_to ‘Remove’, classification_path(category, p), :method => :delete
Though i have realised that i have 2 choices for the create side of
this. Either have the link pointing to new then redirect to create from
the controller. Or even move the create logic to the new method.
or
I could embed the form_for into the
- and have it work without
changing the controller methods. Also, this is just theory for the
embedding the form, i have not tried it yet. Not sure if it can be done.
Suggestions?