Sha256: 602b8dde3bf912eba74b14ed7a82a485c4eeafb4d8fa7133e677a28d50af3863

Contents?: true

Size: 503 Bytes

Versions: 2

Compression:

Stored size: 503 Bytes

Contents

require 'action_view'

module ActiveDecorator
  module Helpers
    def method_missing(method, *args, &block)
      super
    #TODO need to make sure who raised the error?
    rescue NoMethodError => no_method_error
      begin
        @@_decorator_view_proxy ||= DecoratorViewProxy.new
        @@_decorator_view_proxy.send method, *args, block
      rescue NoMethodError
        raise no_method_error
      end
    end

    class DecoratorViewProxy
      include ::ActionView::Helpers
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_decorator-0.2.0 lib/active_decorator/helpers.rb
active_decorator-0.1.0 lib/active_decorator/helpers.rb