Skip to content

Commit 18dec73

Browse files
committed
Helper#icon prepends fa- to given fa class string
ex: icon('flag 2x') rather than icon('flag', class: 'fa-2x')
1 parent 2132ef6 commit 18dec73

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/font_awesome/sass/rails/helpers.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ module ViewHelpers
55
def icon(icon, text = nil, html_options = {})
66
text, html_options = nil, text if text.is_a?(Hash)
77

8-
icons = icon.split(" ").map { |icon| "fa-#{icon}" }.join(" ")
9-
content_class = "fa #{icons}"
8+
content_class = "fa #{icon.split(' ').map { |i| "fa-#{i}" }.join(' ')}"
109
content_class << " #{html_options[:class]}" if html_options.key?(:class)
1110
html_options[:class] = content_class
1211

0 commit comments

Comments
 (0)