Reputation: 3177
Suppose I have the following parameters:
"struct"=> {"content" => nil}, "name" => "structA"
When I try to build a strong parameters filter around it:
params = ActionController::Parameters.new("struct"=> {"content" => nil}, "name" => "structA")
params.permit(:struct, :name)
It only accept name:
=> {"name"=>"structA"}
I read some of the post that for the nested attribute, I need to use "require":
params.require("struct").permit!
But how can I chain the nested and non-nested attribute as one filter?
Upvotes: 0
Views: 676