In the controller, how can I add a variable at the end of params []?
If I try this, I get the error message: params [: group_] + variable
How to do it?
Edit for request
Ok, I have a form that sets up groups of radio buttons with these names:
group_01DRN0
Obviously, I have different groups in the form (group_01AAI0, group_01AUI0, etc.), and the value is set according to the switch selected inside the group:
The "group_01DRN0" camera may have a value of "21" or "22" or "23", the switch "group_01AAI0" may have a value of "21" or "22" or "23", etc.
I have every code in the database (01DRN0, 01AAI0, 01AUI0, etc.), so I want to select them from the database and iterate over the params value so that I can get the value of the switch group, I tried this without luck:
@codes=Code.get_codes
for c in @codes
@all=params[:group_] + c.name
end
Thank.
source
share