Class: Smithy::Liquid::Tags::Html::SmithyStylesheetLinkTag

Inherits:
Base
  • Object
show all
Defined in:
lib/smithy/liquid/tags/html.rb

Constant Summary

Constants inherited from Base

Base::Syntax

Instance Method Summary collapse

Methods inherited from Base

#initialize, #tag, #tag_with_ext, #tag_without_ext

Constructor Details

This class inherits a constructor from Smithy::Liquid::Tags::Html::Base

Instance Method Details

#render(context) ⇒ Object



56
57
58
59
60
61
62
# File 'lib/smithy/liquid/tags/html.rb', line 56

def render(context)
  controller = context.registers[:controller]
  stylesheet = Smithy::Template.stylesheets.find_by(name: tag_without_ext('css'))
  path = "/templates/stylesheets/#{tag_with_ext('css')}"
  path += "?#{stylesheet.updated_at.to_s(:number)}" if stylesheet.present?
  controller.view_context.send(:stylesheet_link_tag, path)
end