Module: IconsHelper

Defined in:
app/helpers/icons_helper.rb

Instance Method Summary collapse

Instance Method Details

#fa_icon_tag(name, opts = {}) ⇒ Object

Icon from FontAwesome. Use the name without the ‘icon-’ prefix. Eg.:

<%= fa_icon_tag "remove" %>


7
8
9
# File 'app/helpers/icons_helper.rb', line 7

def fa_icon_tag(name, opts={})
  (:i, nil, class: "fa fa-#{name} #{opts[:class]}")
end

#glyphicon_tag(name, opts = {}) ⇒ Object

Icon from Glyphicon Icons. Use the name without the ‘glyphicon glyphicon-’ prefix. Eg.:

<%= glyphicon_tag "cloud-download" %>


16
17
18
# File 'app/helpers/icons_helper.rb', line 16

def glyphicon_tag(name, opts={})
  (:i, nil, class: "glyphicon glyphicon-#{name} #{opts[:class]}")
end

#ionicon_icon_tag(name, opts = {}) ⇒ Object

Icon from Ionicons. Use the name without the ‘icon ion-’ prefix. Eg.:

<%= ionicon_icon_tag "remove" %>


25
26
27
# File 'app/helpers/icons_helper.rb', line 25

def ionicon_icon_tag(name, opts={})
  (:i, nil, class: "icon ion-#{name} #{opts[:class]}")
end

#mdi_icon_tag(name, opts = {}) ⇒ Object

Icon from Material Design Icons. Eg.:

<%= mdi_icon_tag "mdi-action-account-box" %>


34
35
36
# File 'app/helpers/icons_helper.rb', line 34

def mdi_icon_tag(name, opts={})
  (:i, name, class: "material-icons #{opts[:class]}")
end

#theme_icon_tag(name, opts = {}) ⇒ Object

Provides a layer of indirection between the template and the actual Icon set being used. Eg.:

<%= theme_icon_tag "mdi-action-account-box" %>


53
54
55
# File 'app/helpers/icons_helper.rb', line 53

def theme_icon_tag(name, opts={})
  themify_icon_tag(name, opts)
end

#themify_icon_tag(name, opts = {}) ⇒ Object

Icon from Themify Icon set. Eg.:

<%= themify_icon_tag "alert" %>


43
44
45
# File 'app/helpers/icons_helper.rb', line 43

def themify_icon_tag(name, opts={})
  (:i, nil, class: "ti-#{name} #{opts[:class]}")
end