Module: Erector::Rails::WidgetExtensions

Defined in:
lib/erector/rails2/extensions/rails_widget.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



107
108
109
# File 'lib/erector/rails2/extensions/rails_widget.rb', line 107

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#__in_erb_templateObject

This is here to force #parent.capture to return the output



123
124
# File 'lib/erector/rails2/extensions/rails_widget.rb', line 123

def __in_erb_template;
end

#capture(&block) ⇒ Object

We need to delegate #capture to parent.capture, so that when the captured block is executed, both erector and Rails output from within the block go to the appropriate buffer.



114
115
116
117
118
119
120
# File 'lib/erector/rails2/extensions/rails_widget.rb', line 114

def capture(&block)
  if parent.respond_to?(:capture)
    raw(parent.capture(&block).to_s)
  else
    super
  end
end