Ruby on Rails
Wednesday, June 25, 2014
On Wednesday, June 25, 2014 10:31:01 AM UTC+1, Chris Butcher wrote:
-- Completed 302 Found in 73ms (ActiveRecord: 67.8ms)
So yeah - "Unpermitted parameters: impact, likelihood". Looks relevant. I have done some research into it, and it seems like one could serialise their inputs in the model using:
serialize :impact, Array
serialize :likelihood, Array
If the input name (as in the name attribute on the input element ends in [] then rails will treat the parameter as an array. I assume simple_form has a way for you to override the input name generated, but I've not used it so I don't know.
Fred
On Tuesday, June 24, 2014 9:56:45 AM UTC+1, Frederick Cheung wrote:
On Monday, June 23, 2014 10:12:04 PM UTC+1, Chris Butcher wrote:<span class="impact-input"><%= f.input :impact, required: false, :error => false, input_html: { class: 'form-control' } %></span><span class="likelihood-input"><%= f.input :likelihood, required: false, :error => false, input_html: { class: 'form-control' } %></span>I don't know much about postgresql array columns and their interaction with simple_form but you should check whether the above form will result in params[risk][:impact] (and likelihood) being a string or an array.If the params are strings it wouldn't surprise me if strong params rejected this since you told it to expect an array (is there anything from strong params in your logfile?)Fred
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4088aee2-4cf3-4251-8aa3-0fd0d8d273dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment