Class: React::Rails::ControllerRenderer
- Inherits:
-
Object
- Object
- React::Rails::ControllerRenderer
- Includes:
- ActionView::Helpers::TagHelper, ActionView::Helpers::TextHelper, ViewHelper
- Defined in:
- lib/react/rails/controller_renderer.rb
Instance Attribute Summary collapse
-
#output_buffer ⇒ Object
Returns the value of attribute output_buffer.
Instance Method Summary collapse
- #call(name, options, &block) ⇒ Object
-
#initialize(options = {}) ⇒ ControllerRenderer
constructor
A new instance of ControllerRenderer.
Methods included from ViewHelper
Constructor Details
#initialize(options = {}) ⇒ ControllerRenderer
Returns a new instance of ControllerRenderer.
8 9 10 11 |
# File 'lib/react/rails/controller_renderer.rb', line 8 def initialize(={}) controller = [:controller] @__react_component_helper = controller.__react_component_helper end |
Instance Attribute Details
#output_buffer ⇒ Object
Returns the value of attribute output_buffer.
6 7 8 |
# File 'lib/react/rails/controller_renderer.rb', line 6 def output_buffer @output_buffer end |
Instance Method Details
#call(name, options, &block) ⇒ Object
13 14 15 16 17 |
# File 'lib/react/rails/controller_renderer.rb', line 13 def call(name, , &block) props = .fetch(:props, {}) = .slice(:data, :tag).merge(prerender: true) react_component(name, props, , &block) end |