The following before filter looks for any Hash parameters where all the keys are integers and turns them into Arrays. It searches recursively to allow the used of nested attributes within nested attributes. This is necessary to circumvent a bug in the strong_parameters gem which was reported in April 2012. Given params like:
{
"person" => {
"dogs_attributes" => {
"0" => {
"name" => "Fido"