Module: SolidWebUi::HeadHelper

Defined in:
lib/solid_web_ui/head_helper.rb

Overview

Emits the dashboards’ stylesheet + theme tokens. Included into ActionView app-wide (see SolidWebUi::Engine) so a host layout can drop ‘<%= solid_web_ui_head_tags %>` into its <head> when rendering the dashboards inside its own chrome (config.layout = “your_layout”).

Defined in lib/ (not app/helpers) because it is mixed into ActionView during boot, before the engine’s autoload paths are ready.

Instance Method Summary collapse

Instance Method Details

#solid_web_ui_head_tagsObject



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/solid_web_ui/head_helper.rb', line 12

def solid_web_ui_head_tags
  tags = []
  if SolidWebUi.config.stylesheet
    tags << stylesheet_link_tag("solid_web_ui", "data-turbo-track": "reload")
  end
  Array(SolidWebUi.config.extra_stylesheets).each do |sheet|
    tags << stylesheet_link_tag(sheet, "data-turbo-track": "reload")
  end
  tags << solid_web_ui_theme_style_tag
  safe_join(tags)
end