Skip to content

Commit

Permalink
Helper#icon prepends fa- to multiple classes, to get <i class='fa fa-…
Browse files Browse the repository at this point in the history
…flag fa-2x'> now we can do:

- icon('flag 2x')
- icon([:flag, '2x'])
  • Loading branch information
nnattawat committed Nov 12, 2015
1 parent 2132ef6 commit 6acfa88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/font_awesome/sass/rails/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ module ViewHelpers
def icon(icon, text = nil, html_options = {})
text, html_options = nil, text if text.is_a?(Hash)

icons = icon.split(" ").map { |icon| "fa-#{icon}" }.join(" ")
content_class = "fa #{icons}"
icons = icon.is_a?(Array) ? icon : icon.to_s.split(' ')
content_class = "fa #{icons.map { |i| "fa-#{i}" }.join(' ')}"
content_class << " #{html_options[:class]}" if html_options.key?(:class)
html_options[:class] = content_class

Expand Down

0 comments on commit 6acfa88

Please sign in to comment.