lib/trestle/form/renderer.rb in trestle-0.10.0 vs lib/trestle/form/renderer.rb in trestle-0.10.1

- old
+ new

@@ -2,13 +2,10 @@ require "action_view/helpers" module Trestle class Form class Renderer - def self.ruby2_keywords(*) - end unless respond_to?(:ruby2_keywords, true) - include ::ActionView::Context include ::ActionView::Helpers::CaptureHelper # Include hook helpers directly so that they are evaluated in the context of the renderer instead of the template. include Hook::Helpers @@ -44,11 +41,11 @@ end concat(result) end - ruby2_keywords def method_missing(name, *args, &block) + def method_missing(name, *args, &block) target = @form.respond_to?(name) ? @form : @template if block_given? && !RAW_BLOCK_HELPERS.include?(name) result = target.send(name, *args) do |*blockargs| render_form(*blockargs, &block) @@ -61,9 +58,10 @@ concat(result) else result end end + ruby2_keywords :method_missing if respond_to?(:ruby2_keywords, true) def respond_to_missing?(name, include_all=false) @form.respond_to?(name, include_all) || @template.respond_to?(name, include_all) || super