Sha256: 49b595aeb638c8837e12eae671a5ad49135e802b7262f3d259b0b3d8dddfac10

Contents?: true

Size: 452 Bytes

Versions: 5

Compression:

Stored size: 452 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

5 entries across 5 versions & 1 rubygems

Version Path
active_decorator-1.3.1 lib/active_decorator/monkey/action_controller/base/rescue_from.rb
active_decorator-1.3.0 lib/active_decorator/monkey/action_controller/base/rescue_from.rb
active_decorator-1.2.0 lib/active_decorator/monkey/action_controller/base/rescue_from.rb
active_decorator-1.1.1 lib/active_decorator/monkey/action_controller/base/rescue_from.rb
active_decorator-1.1.0 lib/active_decorator/monkey/action_controller/base/rescue_from.rb