draper/lib/draper/helper_proxy.rb

18 lines
383 B
Ruby
Raw Normal View History

2012-10-14 22:01:15 +00:00
module Draper
2013-01-07 16:33:24 +00:00
# Provides access to helper methods - both Rails built-in helpers, and those
# defined in your application.
2012-10-14 22:01:15 +00:00
class HelperProxy
2013-01-07 16:33:24 +00:00
# Sends helper methods to the view context.
2012-10-14 22:01:15 +00:00
def method_missing(method, *args, &block)
view_context.send(method, *args, &block)
end
private
def view_context
Draper::ViewContext.current
end
end
end