Sha256: c967c9520039004b2f416271d6583b030abcd582925b135ec2f4ca121bd80858

Contents?: true

Size: 433 Bytes

Versions: 10

Compression:

Stored size: 433 Bytes

Contents

# frozen_string_literal: true

# A monkey-patch for Rails controllers/mailers that auto-decorates ivars
# that are passed to views.
module ActiveDecorator
  module Monkey
    module AbstractController
      module Rendering
        def view_assigns
          hash = super
          hash.each_value do |v|
            ActiveDecorator::Decorator.instance.decorate v
          end
          hash
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
active_decorator-1.4.1 lib/active_decorator/monkey/abstract_controller/rendering.rb
active_decorator-1.4.0 lib/active_decorator/monkey/abstract_controller/rendering.rb
active_decorator-1.3.4 lib/active_decorator/monkey/abstract_controller/rendering.rb
active_decorator-1.3.3 lib/active_decorator/monkey/abstract_controller/rendering.rb
active_decorator-1.3.2 lib/active_decorator/monkey/abstract_controller/rendering.rb
active_decorator-1.3.1 lib/active_decorator/monkey/abstract_controller/rendering.rb
active_decorator-1.3.0 lib/active_decorator/monkey/abstract_controller/rendering.rb
active_decorator-1.2.0 lib/active_decorator/monkey/abstract_controller/rendering.rb
active_decorator-1.1.1 lib/active_decorator/monkey/abstract_controller/rendering.rb
active_decorator-1.1.0 lib/active_decorator/monkey/abstract_controller/rendering.rb