Created
November 27, 2014 17:23
-
-
Save yuki24/0a5eb15bc6197bf45e60 to your computer and use it in GitHub Desktop.
Force-return a JSON response. Always.
This file contains 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 ApplicationController < ActionController::Base | |
before_filter :override_request_formats | |
def override_request_formats | |
request.formats = [:json] | |
end | |
... | |
end |
This file contains 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
YourApp::Application.configure do | |
... | |
config.consider_all_requests_local = false | |
... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment