Given this hash that comes though :params
"positions"=>{
"1"=>{"x"=>"50", "y"=>"30"},
"2"=>{"x"=>"22", "y"=>"53"},
"3"=>{"x"=>"68", "y"=>"35"}
}
How would I do this? (doesn't work, but attempting to show what I want to do)
params[:positions].each do |position|
logger.info(position.x)
end
I know, painfully beginner stuff ...
I get a NoMethodError (undefined method 'x' for ["1", {"x"=>"50", "y"=>"30"}]:Array)