Class: TinyAdmin::Views::Components::Head

Inherits:
BasicComponent
  • Object
show all
Defined in:
lib/tiny_admin/views/components/head.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BasicComponent

#update_attributes

Instance Attribute Details

#extra_stylesObject

Returns the value of attribute extra_styles.



7
8
9
# File 'lib/tiny_admin/views/components/head.rb', line 7

def extra_styles
  @extra_styles
end

#page_titleObject

Returns the value of attribute page_title.



7
8
9
# File 'lib/tiny_admin/views/components/head.rb', line 7

def page_title
  @page_title
end

Returns the value of attribute style_links.



7
8
9
# File 'lib/tiny_admin/views/components/head.rb', line 7

def style_links
  @style_links
end

Instance Method Details

#view_templateObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/tiny_admin/views/components/head.rb', line 9

def view_template
  head {
    meta charset: 'utf-8'
    meta name: 'viewport', content: 'width=device-width, initial-scale=1'
    title {
      page_title
    }
    style_links.each do |style_link|
      link(**style_link)
    end
    style { extra_styles } if extra_styles
  }
end