Skip to content
Shows a nice custom error page with a lolcat connected to the 404 403 and 500 errors
Find file
Pull request Compare This branch is 3 commits behind Narnach:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
app/views
lib
public
tasks
Readme.rdoc
init.rb
install.rb

Readme.rdoc

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
Something went wrong with that request. Please try again.