mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-31 05:05:18 +01:00
Add a helper for fixed-width icons
This commit is contained in:
parent
73a6925054
commit
1dfdad96fe
2 changed files with 28 additions and 0 deletions
15
app/helpers/icon_helper.rb
Normal file
15
app/helpers/icon_helper.rb
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
module IconHelper
|
||||
include FontAwesome::Sass::Rails::ViewHelpers
|
||||
|
||||
def icon_fw(icon, text = nil, html_options = {})
|
||||
text, html_options = nil, text if text.is_a?(Hash)
|
||||
|
||||
if html_options.key?(:class)
|
||||
html_options[:class] = "fa-fw #{html_options[:class]}"
|
||||
else
|
||||
html_options[:class] = "fa-fw"
|
||||
end
|
||||
|
||||
icon(icon, text, html_options)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue