Sha256: 08b1f2e078c137a88b762e27390c67dfe2be79c0cdf7879ac6fcd437df0620e4

Contents?: true

Size: 478 Bytes

Versions: 2

Compression:

Stored size: 478 Bytes

Contents

module Erector
  Widget.class_eval do
    def output
      if helpers.respond_to?(:output_buffer)
        helpers.output_buffer
      else
        @output
      end
    end

    def capture_with_helpers(&block)
      if helpers
        helpers.capture(&block)
      else
        capture_without_helpers(&block)
      end
    end
    alias_method_chain :capture, :helpers

    # This is here to force #helpers.capture to return the output
    def __in_erb_template; end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
erector-0.5.1 lib/erector/rails/extensions/widget/2.2.0/widget.rb
erector-0.5.0 lib/erector/rails/extensions/widget/2.2.0/widget.rb