Given these strong parameters in a Rails controller:
def user_params
params.require(:user).permit(details: [{ group: %i[type value] }])
end
How do I sanitize the details array before it's persisted into a JSONB column?
Given these strong parameters in a Rails controller:
def user_params
params.require(:user).permit(details: [{ group: %i[type value] }])
end
How do I sanitize the details array before it's persisted into a JSONB column?
I wrote a solution for anyone else with a similar problem: