I have an array field in my model and I\'m attempting to update it.
My strong parameter method is below
def post_params
params[\"post\"][\"categor
The permitted scalar types are String
, Symbol
, NilClass
, Numeric
, TrueClass
, FalseClass
, Date
, Time
, DateTime
, StringIO
, IO
, ActionDispatch::Http::UploadedFile
and Rack::Test::UploadedFile
.
To declare that the value in params must be an array of permitted scalar values map the key to an empty array:
params.permit(:id => [])
This is what the strong parameters documentation on Github says:
params.require(:post).permit(:name, :email, :categories => [])
I hope this works out for you.