Blog

nifty_errorpages gem

nifty_errorpages gem

Today I wrote a little gem called NiftyErrorpages. This gem contains a little Rails 3.2 engine for generating dynamic error pages. If an error occures, normally Rails will render a static 404.html, 422.html or 500.html file from the public folder. NiftyErrorpages allows you to handle all the rendering through an errors_controller with views. You can easily customize your views, layout, helper and controller.

The gem name is derived from the awesome NiftyGenerators Gem from Ryan Bates, because the default error pages have a quite similar style as the nifty generator views :-).

 

Quick Start

gem install nifty_errorpages

Or add it to your Gemfile:

gem "nifty_errorpages"

 

Generators

There are following generators available for customizing your error pages and the behaviour:

rails g nifty_errorpages:views          # generates view files
rails g nifty_errorpages:controllers    # generates controller files
rails g nifty_errorpages:helpers        # generates helper files

Or simple generate all files

rails g nifty_errorpages:all            # generates all files

 

Conclusion

This gem is very comfortable to customize error pages and it is quite simply and easy to expand. Just check it out - it´s worth a try ;-).

The source code is available on github: [LINK]

23.04.2013
Matthias Frick
Ruby on Rails
0 Kommentare

Über den Autor

Matthias Frick
Matthias Frick, MSc.

Er ist ein langjähriger Ruby-on-Rails Entwickler und leitet das Unternehmen Frick-Web.

0 Kommentare zu "nifty_errorpages gem"

Kommentar verfassen