Module: ActiveDecorator::Helpers

Defined in:
lib/active_decorator/helpers.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/active_decorator/helpers.rb', line 3

def method_missing(method, *args, &block)
  super
#TODO need to make sure who raised the error?
rescue NoMethodError, NameError => original_error
  begin
    ActiveDecorator::ViewContext.current.send method, *args, &block
  rescue NoMethodError, NameError
    raise original_error
  end
end