Module: Interage::MaterialDesignIconsHelper
- Included in:
- ApplicationHelper
- Defined in:
- lib/interage/material_design_icons_helper.rb
Constant Summary collapse
- MD_ICON_TEXT_CLASS =
'text'
Instance Method Summary collapse
- #md_classes(icon, options = {}) ⇒ Object
- #md_icon(icon, options = {}) ⇒ Object
- #md_icon_text(icon, text, options = {}) ⇒ Object
Instance Method Details
#md_classes(icon, options = {}) ⇒ Object
23 24 25 |
# File 'lib/interage/material_design_icons_helper.rb', line 23 def md_classes(icon, = {}) app_icon_classes(icon, 'material-icons', 'md', ) end |
#md_icon(icon, options = {}) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/interage/material_design_icons_helper.rb', line 7 def md_icon(icon, = {}) icon_classes = icon.to_s.split icon = icon_classes.shift content_tag :i, class: md_classes(icon, ) do t("icons_alias.#{icon}", default: icon) end end |
#md_icon_text(icon, text, options = {}) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/interage/material_design_icons_helper.rb', line 16 def md_icon_text(icon, text, = {}) content_tag :span do concat md_icon(icon, ) concat content_tag(:span, " #{text}", class: MD_ICON_TEXT_CLASS) end end |