Sha256: 1b7539627cc262f14aa9308caa2d0e2c1d29a0062533c9cb63be9c1a7e1133a0

Contents?: true

Size: 551 Bytes

Versions: 7

Compression:

Stored size: 551 Bytes

Contents

module ExceptionallyBeautiful
  module ErrorHandler
    def error_handler(status_code)
      @error = ExceptionallyBeautiful::Error.new(status_code)

      respond_to do |format|
        format.html do
          render :template => "#{ExceptionallyBeautiful.controller}/#{ExceptionallyBeautiful.action}",
                 :status => @error.status_code,
                 :layout => ExceptionallyBeautiful.layout
        end
        format.json { render :json => { :status => @error.status_code, :error => @error.message } }
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
exceptionally_beautiful-0.1.5 app/controllers/concerns/exceptionally_beautiful/error_handler.rb
exceptionally_beautiful-0.1.4 app/controllers/concerns/exceptionally_beautiful/error_handler.rb
exceptionally_beautiful-0.1.3 app/controllers/concerns/exceptionally_beautiful/error_handler.rb
exceptionally_beautiful-0.1.2 app/controllers/concerns/exceptionally_beautiful/error_handler.rb
exceptionally_beautiful-0.1.1 app/controllers/concerns/exceptionally_beautiful/error_handler.rb
exceptionally_beautiful-0.1.0 app/controllers/concerns/exceptionally_beautiful/error_handler.rb
exceptionally_beautiful-0.0.1 app/controllers/concerns/exceptionally_beautiful/error_handler.rb