Sha256: 61653e82c662ed9a01fb11b39ee538584bcce44bb533d6422eb29f31b66dbe14

Contents?: true

Size: 444 Bytes

Versions: 6

Compression:

Stored size: 444 Bytes

Contents

module Draper
  class HelperProxy
    # Some helpers are private, for example html_escape... as a workaround
    # we are wrapping the helpers in a delegator that passes the methods
    # along through a send, which will ignore private/public distinctions
    def method_missing(method, *args, &block)
      view_context.send(method, *args, &block)
    end

    private

    def view_context
      Draper::ViewContext.current
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
draper-1.0.0.beta6 lib/draper/helper_proxy.rb
draper-1.0.0.beta5 lib/draper/helper_proxy.rb
draper-1.0.0.beta4 lib/draper/helper_proxy.rb
draper-1.0.0.beta3 lib/draper/helper_proxy.rb
draper-1.0.0.beta2 lib/draper/helper_proxy.rb
draper-1.0.0.beta1 lib/draper/helper_proxy.rb