FineLinePrototyping/angularjs-rails-resource — pull request #15 by tpodom (2013-04-09 14:11:09+00:00)
Title: Fixes #14 AngularJS 1.1

Fix for #14.

Updated default config to add Accept application/json header with the ability to still override that with custom Accept headers.

@tbrooke sent me some info regarding a post on AngularJS regarding the 1.1 release. It appears that Rails doesn't like when the Accept headers are "'application/json, text/plain, */*". It used to work because AngularJS also added X-Requested-With set to XMLHttpRequest which Rails seems to interpret and treat as JSON.

I was able to reproduce the errors with AngularJS 1.1 and changing to pass just "Accept: application/json" seems to fix the problem.