I’m having a perplexing problem with Rails 3.2.6 and JQuery 1.7.2.
I’ve been trying to make POST requests to my server, but for some reason only GETs are showing up in my logs.
For example, when I type this in my Javascript console…
$.ajax({
type: 'POST',
url: 'trials'
});
… my logs show this:
Started GET "/trials" for 127.0.0.1 at 2012-07-21 21:43:17 -0400
Processing by TrialsController#index as JSON
Trial Load (0.2ms) SELECT "trials".* FROM "trials"
Completed 200 OK in 88ms (Views: 2.7ms | ActiveRecord: 1.1ms)
I checked rake routes, but it clearly says that POSTs should be going to trials#create, not trials#index:
trials GET /trials(.:format) trials#index
POST /trials(.:format) trials#create
new_trial GET /trials/new(.:format) trials#new
edit_trial GET /trials/:id/edit(.:format) trials#edit
trial GET /trials/:id(.:format) trials#show
PUT /trials/:id(.:format) trials#update
DELETE /trials/:id(.:format) trials#destroy
I’m new to web development… so… Help!
What’s going on here?
Why on earth are my POSTs being converted to GETs??
Hmm… so I switched browsers and now it’s all working. I had been using a nightly build of WebKit from a few months ago. I upgraded to the latest version and now everything works fine. I guess it was a webkit bug. Phew!