I'm trying to store a serialized Ransack search in a text column. It's deeply nested and I'm struggling coming up with permit call for it. Here's a sample hash:
{
"c"=>{
"0"=>{
"a"=>{
"0"=>{
"name"=>"column_1"
}
},
"p"=>"eq",
"v"=>{
"0"=>{
"value"=>"value_1"
}
}
},
"1"=>{
"a"=>{
"0"=>{
"name"=>"column_2"
}
},
"p"=>"cont",
"v"=>{
"0"=>{
"value"=>"value_2"
}
}
}
}
}
How would you write a permit for that? This is my best guess for reading the doc but it isn't working.
def course_listing_params
params.require(:course_listing).permit({ q: { c: [{ a: [:name] }, :p, { v: [:value] }] } })
end