How to manage dynamic lines coming from a form in a controller
I have a form that submits a dynamic number of rows and columns. Here's a demo on jsFiddle of what the form looks like.
I have columns of red, yellow and green, and there may be a dynamic number of rows associated with those shades of colors. Each line has a text box and checkboxes.
How can I keep track of what has been selected by the user in my save()
action controller ?
For example, for the following screenshot from the form
I am getting the following response back to the controller:
[red:on, green:[on, on], shade:[light, dark, , ], action:save]
Question
Now the problem is that although I have all the shades that the user entered, I have no way of plugging back in which rows the checkboxes were checked for the different color columns.
I am interested to know how to do this in Grails / Rails or other frameworks.
source to share