Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails Completed 406 Not Acceptable

I don't know what the heck is going on here, I just updated my rails from 3.1.0rc4 to 3.1.0 and I suddenly find that all ajax won't work, It's causing 406 error all the time. Everything was perfectly fine before I update to 3.1.0

Guys, I am going to lose controll now, help me.

like image 682
castiel Avatar asked Oct 18 '11 13:10

castiel


1 Answers

Make sure that you're setting the correct content-type and that your controllers respond to the specified format. This often happens if the request content-type is set to 'application/json' and your controller doesn't have either respond_to :json declared or a format.json response in your action.

like image 70
dogenpunk Avatar answered Sep 28 '22 12:09

dogenpunk