Class: ChartBibz::ViewComponents::CanvasViewComponent
- Inherits:
-
ApplicationViewComponent
- Object
- ApplicationViewComponent
- ChartBibz::ViewComponents::CanvasViewComponent
- Defined in:
- lib/chart_bibz/view_components/canvas_view_component.rb
Overview
Generate the canvas view through the render method
Constant Summary collapse
- WIDTH =
Constants
400- HEIGHT =
Default width for the html canvas
400
Instance Attribute Summary
Attributes inherited from ApplicationViewComponent
Instance Method Summary collapse
-
#id ⇒ String
Get the id.
-
#initialize(args = {}) ⇒ void
constructor
Only html_options can be passed.
-
#render ⇒ String
Generate the html canvas.
Constructor Details
#initialize(args = {}) ⇒ void
Only html_options can be passed
21 22 23 |
# File 'lib/chart_bibz/view_components/canvas_view_component.rb', line 21 def initialize(args = {}) @args = args end |
Instance Method Details
#id ⇒ String
Get the id
46 47 48 |
# File 'lib/chart_bibz/view_components/canvas_view_component.rb', line 46 def id [:id] end |
#render ⇒ String
Generate the html canvas
34 35 36 |
# File 'lib/chart_bibz/view_components/canvas_view_component.rb', line 34 def render tag.canvas(**) end |