Skip to content

Instantly share code, notes, and snippets.

@christopherslee
Created April 25, 2012 02:06
Show Gist options
  • Save christopherslee/2485525 to your computer and use it in GitHub Desktop.
Save christopherslee/2485525 to your computer and use it in GitHub Desktop.
Rails turns JSON array into numbered hash in controller params
app = window.app = {
doSomething: ->
jQuery.ajax
type : "POST"
path : "/"
datatype : "JSON"
data : { arraystuff : [ { foo : "bar" }, { bar : "baz" }, { baz : "bop" } ] }
return
}
Started POST "/" for 127.0.0.1 at 2012-04-24 22:10:15 -0400
Processing by WelcomeController#index as */*
Parameters: {"arraystuff"=>{"0"=>{"foo"=>"bar"}, "1"=>{"bar"=>"baz"}, "2"=>{"baz"=>"bop"}}}
Rendered welcome/index.html.erb within layouts/application (0.0ms)
Completed 200 OK in 19ms (Views: 18.8ms | ActiveRecord: 0.0ms)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment