PublicRescue

PublicRescue is a gem for rails application who want to display dynamic error pages. It creates a new Rack middleware which replaces ActionDispatch::ShowExceptions and overwrites the rescue_action_in_public method.

Requirements

  • Rails ~> 3.0.0

Installation

This library is intended to be installed as a gem $ gem install public_rescue

After you installed PublicRescue, you need to add it to your Gemfile and you’re done ! It will use the default views included with PublicRescue.

Customization

PublicRescue comes with 2 generators.

$ rails g public_rescue:views This will install all views into app/view/public_rescue/public_errors. You can now customize your views.

If you need to have access to the controller, you can run :

$ rails g public_rescue NAME This will generate a controller that inherits from PublicRescue::PublicErrorsController and install the views into app/views/NAME. In the controller you have access to the env['public_rescue.exception_details'] variable which contains additional information about the exception :

env = { :request,

	:exception,
	:status,
	:application_trace,
	:framework_trace,
	:full_trace

}

TODO

I should probably write some true tests…

Contributing to public_rescue

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it

  • Fork the project

  • Start a feature/bugfix branch

  • Commit and push until you are happy with your contribution

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright © 2011 Cyril Picard. See LICENSE.txt for further details.