class Draper::HelperProxy
Provides access to helper methods - both Rails
built-in helpers, and those defined in your application.
Attributes
Public Class Methods
Source
# File lib/draper/helper_proxy.rb, line 30 def self.define_proxy(name) define_method name do |*args, &block| view_context.send(name, *args, &block) end ruby2_keywords name end
Source
# File lib/draper/helper_proxy.rb, line 6 def initialize(view_context) @view_context = view_context end
@overload initialize(view_context
)
Public Instance Methods
Source
# File lib/draper/helper_proxy.rb, line 11 def method_missing(method, *args, &block) self.class.define_proxy method send(method, *args, &block) end
Source
# File lib/draper/helper_proxy.rb, line 18 def respond_to_missing?(method, include_private = false) super || view_context.respond_to?(method) end
Checks if the context responds to an instance method, or is able to proxy it to the view context.
Calls superclass method