For the hash, you can find the size using the .size method.
The problem is not with the size method here, the problem is with ActionController::Parameters , which is not a hash,
Look at the first line inside ActionController::Parameters
"0"=>{priority"=>"24", "style"=>"three_pictures"}
it must follow " missing before priority
"0"=>{"priority"=>"24", "style"=>"three_pictures"}
After that .size method should work
source share