Skip to content

ForbiddenAttributesError not raising for params with Array of hashes #159

sumisha-sourcebits opened this Issue Jul 25, 2013 · 0 comments

1 participant


If your parameter is an array of hashes and expecting to create multiple objects by looping the array, it creates the object successfully without raising ForbiddenAttributesError.

Assume the parameter as below:

params[:users] = [{:name => "test", :email => ""}, {:name => "test1", :email => ""}]

Controller code where params[:users] being looped and trying to create a user object one by one.

params[:users].each do |user_params|
  user =
@fxn fxn closed this in 62c0efb Dec 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.