Last active
December 21, 2015 18:09
-
-
Save r38y/6345790 to your computer and use it in GitHub Desktop.
Render custom template for 404s
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
module FourOhFour | |
extend ActiveSupport::Concern | |
included do | |
rescue_from ActiveRecord::RecordNotFound, ActionController::RoutingError, with: :render_404 | |
end | |
def render_404 | |
render template: 'error_pages/404', status: :not_found, format: [:html] and return false | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment