Cuba::Errors
Error helpers for Cuba.
Installation
Add this line to your application's Gemfile:
gem 'cuba-errors'
And then execute:
$ bundle
Or install it yourself as:
$ gem install cuba-errors
Usage
See an example:
require 'cuba'
require 'cuba/errors'
require 'cuba/render'
Cuba.plugin Cuba::Errors
Cuba.plugin Cuba::Render
# This setting specifies which view is going to be used for rendering a 404
# page. If not set, nothing will be rendered.
Cuba.settings[:errors][:not_found] = 'not_found'
Cuba.define do
on default do
# sets status = 404
# sets Content-Type = text/html; charset=utf-8
# renders views/not_found.erb
not_found!
end
end
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 a new Pull Request
License
See the LICENSE.