At the moment I have a form_tag which contains inputs and puts these inputs into parameters. I want to be able to loop over them in the controller action.
I've tried getting all params
excluding all the usual params
(action, controller, model name etc.) and then using a wildcard like params[:prop*]
.
Here is the offending form inputs:
%input{:name => "userEmails", :id =>"userEmails", :type => "hidden", :value => ""}
-@all_properties.each do |prop|
%input{:name => "prop"+prop.name+"checkbox", :type => "checkbox", :id => "prop"+prop.name+"checkbox"}
#{prop.name}
%input{:name => "prop"+prop.name, :type => "text", :id => "prop"+prop.name}
These show up in params like {"propProperty1checkbox"=>"on", "propProperty1" => "testing", "propAnotherPropertycheckbox" => "on", "propAnotherProperty" => "another test value"}
etc.
I'm unsure how to access these as the names of the properties can change and so need to be accessed abstractly.