Class: Views::Html
- Inherits:
-
Object
- Object
- Views::Html
- Includes:
- HtmlSlice
- Defined in:
- lib/roda/templates/front-end/app/views/html.rb
Instance Attribute Summary collapse
-
#foo ⇒ Object
readonly
for more component classes.
Instance Method Summary collapse
- #css_entrypoint_tag(entrypoint) ⇒ Object
-
#initialize(t) ⇒ Html
constructor
A new instance of Html.
- #js_entrypoint_tag(entrypoint) ⇒ Object
- #navbar ⇒ Object
Constructor Details
Instance Attribute Details
#foo ⇒ Object (readonly)
for more component classes
6 7 8 |
# File 'lib/roda/templates/front-end/app/views/html.rb', line 6 def foo @foo end |
Instance Method Details
#css_entrypoint_tag(entrypoint) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/roda/templates/front-end/app/views/html.rb', line 21 def css_entrypoint_tag(entrypoint) if Config.not_production? "<link rel=\"stylesheet\" href=\"/public/assets/#{entrypoint}.css\" />" else "<link rel=\"stylesheet\" href=\"#{Config.get[:assets][:host]}/#{Config.get[:assets][:manifest]["#{entrypoint}.css"]}\" />" end end |
#js_entrypoint_tag(entrypoint) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/roda/templates/front-end/app/views/html.rb', line 13 def js_entrypoint_tag(entrypoint) if Config.not_production? "<script src=\"/public/assets/#{entrypoint}.js\" defer></script>" else "<script src=\"#{Config.get[:assets][:host]}/#{Config.get[:assets][:manifest]["#{entrypoint}.js"]}\" defer></script>" end end |
#navbar ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/roda/templates/front-end/app/views/html.rb', line 29 def html_slice do div class: "navbar" do a "home", href: "/" a "foo/bar", href: "/foo/bar" end end end |