Skip to content

Instantly share code, notes, and snippets.

@r38y
Last active December 21, 2015 18:09
Show Gist options
  • Save r38y/6345790 to your computer and use it in GitHub Desktop.
Save r38y/6345790 to your computer and use it in GitHub Desktop.
Render custom template for 404s
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