Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Shows a nice custom error page with a lolcat connected to the 404 403 and 500 errors

Notifications You must be signed in to change notification settings

Narnach/rails_custom_error_pages

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CustomErrorPages

Rails plugin that shows error pages with a funny photo on them instead of the boring Rails error pages.

In development mode it will only trigger on obvious errors, like routing errors and Acl9 authentication errors. In production mode it will trigger on all errors, but it does return the appropriate 404, 403 or 500 status code.

Each status code has its own directory with images, so you can adjust them to your liking.

The errors CustomErrorPages handles can be changed by overriding the following methods in any controller:

class ApplicationController < ActionController::Base
  def self.access_denied_errors
    super # Handle all default errors
  end

  # Handle ActiveResource errors if ActiveResource is present
  def self.not_found_errors
    if defined?(ActiveResource::ResourceNotFound)
      super + [ActiveResource::ResourceNotFound]
    else
      super
    end
  end

  def self.real_errors
    super # Handle all default errors
  end
end

Controller methods that are required for CustomErrorPages to work:

login_path :: named route to login url
current_user :: currently logged in user object or nil if there is no logged in user

About

Shows a nice custom error page with a lolcat connected to the 404 403 and 500 errors

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%