0.0
No commit activity in last 3 years
No release in over 3 years
Error helpers for Cuba.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 3.0
>= 0
 Project Readme

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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

See the LICENSE.