Last active
August 29, 2015 14:13
-
-
Save davejlong/b7a64ceaef019cae038a to your computer and use it in GitHub Desktop.
Angular With Rails - Fixing XHR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyController < ApplicationController | |
def show | |
@something = MyModel.all | |
render layout: false if request.xhr? | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('myModule').config ['$httpProvider', ($httpProvider) -> | |
$httpProvider.defaults.headers.common.['X-Requested-With'] = 'AngularXMLHttpRequest' | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment