I'm receiving a JSON package like:
{
"point_code" : { "guid" : "f6a0805a-3404-403c-8af3-bfddf9d334f2" }
}
I would like to tell Rails that both point_code
and guid
are required, not just permitted.
This code seems to work but I don't think it's good practice since it returns a string, not the full object:
params.require(:point_code).require(:guid)
Any ideas how I could do this?
question from:https://stackoverflow.com/questions/22487878/strong-parameters-require-multiple