Module: Halt
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/halt.rb,
lib/halt/error.rb,
lib/halt/engine.rb,
lib/halt/version.rb
Overview
An extension to ActionController which enables standard error handling using ActionView and translations.
Defined Under Namespace
Constant Summary collapse
- VERSION =
'1.0.0'.freeze
Instance Method Summary collapse
Instance Method Details
#halt(status, **options) ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/halt.rb', line 37 def halt(status, **) @error = Error.new(status, **) respond_to do |format| format.html { render 'error', status: @error.status, error: @error } format.json { render json: @error, status: @error.status } end && return end |