I have a form that is set up to create an object (Device), and the Device has_many Abilities.
I can set this up fairly easily with a form where the Abilities are user selectable (e.g. with checkboxes). However, I would like to set these up in the controller, since they will not be user selectable (they will be based on some other parameters passed when the Device is created, e.g. the device type).
How can I set up the controller so that I can essentially hard-wire the has_many relationships based on the type of device that is created?
Thanks!
EDIT: Renames Actions to Abilities to avoid confusion
You can set associations like this using some of the methods Rails automatically defines when you set up the association. Basically, you should be able to go