Created
May 12, 2014 17:54
-
-
Save xionon/d055b8ed4c972dca18e7 to your computer and use it in GitHub Desktop.
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 | |
# see: http://guides.rubyonrails.org/action_controller_overview.html#rescue-from | |
rescue_from ApiKey::NotAuthorized, with: :api_key_not_authorized | |
rescue_from ActiveRecord::RecordNotFound, with: :record_not_found | |
private | |
# see: http://guides.rubyonrails.org/layouts_and_rendering.html#options-for-render | |
def record_not_found | |
render file: '404.html', status: :not_found | |
end | |
def api_key_not_allowed | |
render file: 'not_authorized.html', status: :unauthorized | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment