Module: Erector::Rails::WidgetExtensions
- Defined in:
- lib/erector/rails/extensions/rails_widget.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#__in_erb_template ⇒ Object
This is here to force #parent.capture to return the output.
-
#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.
Class Method Details
.included(base) ⇒ Object
104 105 106 |
# File 'lib/erector/rails/extensions/rails_widget.rb', line 104 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#__in_erb_template ⇒ Object
This is here to force #parent.capture to return the output
120 121 |
# File 'lib/erector/rails/extensions/rails_widget.rb', line 120 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.
111 112 113 114 115 116 117 |
# File 'lib/erector/rails/extensions/rails_widget.rb', line 111 def capture(&block) if parent.respond_to?(:capture) raw(parent.capture(&block).to_s) else super end end |