Sha256: b4f6b1569028ccac514e33fa5dcac773ba47c987eba0a83d73cc2b269cd8a0a9

Contents?: true

Size: 432 Bytes

Versions: 2

Compression:

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

2 entries across 2 versions & 1 rubygems

Version Path
active_decorator-1.0.0 lib/active_decorator/monkey/abstract_controller/rendering.rb
active_decorator-0.9.0 lib/active_decorator/monkey/abstract_controller/rendering.rb