Ive got 3 tables, projects, devices and projectdevice (table that links the 2 for a many to many relation). A device is connected to an account and in the account management the device can be connected to a project. I want to do this by using checkboxes. When creating or editing a project there should be a list of all devices and the possibility to select them.
In other words, how do I fill the projectdevice table by using checkboxes?
I am using ActiveRecord to access my data
Well, I dont think this will automatically work, so you will have to build out the grid your self and then parse the results to re-persist them. Its not actually that hard. I have written a sample app for you below…
Controller:
Device Model:
Project Model:
LinkDeviceAndProject (View Model):
View: