Module: WeatherSeven::Rails::IconHelper
- Defined in:
- app/helpers/weather_seven/rails/icon_helper.rb
Defined Under Namespace
Modules: Private
Instance Method Summary collapse
-
#w7_icon(names = "wind", options = {}) ⇒ Object
Creates an icon tag given an icon name and possible icon modifiers.
Instance Method Details
#w7_icon(names = "wind", options = {}) ⇒ Object
Creates an icon tag given an icon name and possible icon modifiers.
Examples
w7_icon "wind"
# => <i class="pe-7w-wind"></i>
w7_icon "wind", class: "pull-left"
# => <i class="pe-7w-wind pull-left"></i>
w7_icon "wind", data: { id: 123 }
# => <i class="pe-7w-wind" data-id="123"></i>
content_tag(:li, w7_icon("wind", text: "Bulleted list item"))
# => <li><i class="pe-7w-wind"></i> Bulleted list item</li>
20 21 22 23 24 25 26 27 28 |
# File 'app/helpers/weather_seven/rails/icon_helper.rb', line 20 def w7_icon(names = "wind", = {}) 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 |