Module: StrokeSeven::Rails::IconHelper
- Defined in:
- app/helpers/stroke_seven/rails/icon_helper.rb
Defined Under Namespace
Modules: Private
Instance Method Summary collapse
-
#s7_icon(names = "album", options = {}) ⇒ Object
Creates an icon tag given an icon name and possible icon modifiers.
Instance Method Details
#s7_icon(names = "album", options = {}) ⇒ Object
Creates an icon tag given an icon name and possible icon modifiers.
Examples
s7_icon "album"
# => <i class="pe-7s-album"></i>
s7_icon "album", class: "pull-left"
# => <i class="pe-7s-album pull-left"></i>
s7_icon "album", data: { id: 123 }
# => <i class="pe-7s-album" data-id="123"></i>
content_tag(:li, s7_icon("album", text: "Bulleted list item"))
# => <li><i class="pe-7s-album"></i> Bulleted list item</li>
20 21 22 23 24 25 26 27 28 |
# File 'app/helpers/stroke_seven/rails/icon_helper.rb', line 20 def s7_icon(names = "album", = {}) classes = [] classes.concat Private.icon_names(names) classes.concat Array(.delete(:class)) text = .delete(:text) right_icon = .delete(:right) icon = content_tag(:i, nil, .merge(:class => classes)) Private.icon_join(icon, text, right_icon) end |