Module: Pulse::SvgHelper
- Included in:
- Component
- Defined in:
- app/lib/pulse/svg_helper.rb
Overview
Helpers for inline svg
Instance Method Summary collapse
-
#render_svg(name, **options) ⇒ Object
Render an embedded svg document.
Instance Method Details
#render_svg(name, **options) ⇒ Object
Note:
Do not include the .svg suffix in the filename
Render an embedded svg document
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/lib/pulse/svg_helper.rb', line 11 def render_svg(name, **) if [:title].blank? [:aria_hidden] ||= true [:aria] = nil else [:aria] ||= true end [:nocomment] ||= true [:class] = class_names( [:class], [:classes] ) filename = "#{name}.svg" inline_svg_tag(filename, **) end |