Sha256: c6ef5a88b510b4aa9a855ac7facab1710990a2941276d879f32f9e32fbacc2ba

Contents?: true

Size: 451 Bytes

Versions: 2

Compression:

Stored size: 451 Bytes

Contents

# frozen_string_literal: true
# A monkey-patch for Action Controller to pass the controller view_context over
# to `render` invocation in `rescue_from` block.
module ActiveDecorator
  module Monkey
    module ActionController
      module Base
        def rescue_with_handler(*)
          ActiveDecorator::ViewContext.push(view_context)
          super
        ensure
          ActiveDecorator::ViewContext.pop
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_decorator-1.0.0 lib/active_decorator/monkey/action_controller/base/rescue_from.rb
active_decorator-0.9.0 lib/active_decorator/monkey/action_controller/base/rescue_from.rb