dynamic_error_pages
Engine that helps you to generate dynamic error pages with Rails
Requirements
rails >= 3.2
Installation
Add this line to your application's Gemfile:
gem 'dynamic_error_pages'
And then execute:
$ bundle
Or install it yourself as:
$ gem install dynamic_error_pages
Usage
Just place your custom error templates inside the app/views/dynamic_error_pages/errors
folder. The files need to
be named like the returned status code. The 404.html.erb
would be used for status code 404 like ActiveRecord::RecordNotFound
would raise for example.
If an error is raised and no template for the status code can be found, the engine will fallback to the 404.html.erb
-template.
That's all!
TODO
- Support more formats
- Write more tests
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request