I am building a rails4 api where i am posting a nested hash of attributes. however, the model does not actually have nested attributes or an association. Attempting to make a cleaner post params hash by combining some attributes into a group, but have the api handle the unwrapping and strong parameters validation.
## Example POST params
params[:item][:group] = {
a: true,
b: false
}
But the model does not actually have a group
column, the attributes a
and b
are attributes directly on the model.
to handle this without the group
wrapper would simply be
params.require(:item).permit(:a, :b)
But I would like to have it pass strong_parameters
submitted with the group
wrapper. How can I achieve this but having the POST params as mentioned above?