Class: JsonSchemaView::Renderers::Json
- Defined in:
- lib/json_schema_view/renderers/json.rb
Overview
Render BaseComponent as json.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#format ⇒ Symbol
Returns the content type of the response.
-
#render_in(view_context) ⇒ String
Render the React component by using react_on_rails.
Methods inherited from Base
Constructor Details
This class inherits a constructor from JsonSchemaView::Renderers::Base
Instance Method Details
#format ⇒ Symbol
Returns the content type of the response. This method is used by ActionView::Template::Renderable.
23 24 25 |
# File 'lib/json_schema_view/renderers/json.rb', line 23 def format :json end |
#render_in(view_context) ⇒ String
Render the React component by using react_on_rails. This method is used by ActionView::Template::Renderable.
14 15 16 17 |
# File 'lib/json_schema_view/renderers/json.rb', line 14 def render_in(view_context) view_context.render view_context.render(json: component.props.to_json) end |