Skip to content

Commit

Permalink
Helper#icon prepends fa- to given fa class string
Browse files Browse the repository at this point in the history
ex: icon('flag 2x') rather than icon('flag', class: 'fa-2x')
  • Loading branch information
nnattawat committed Nov 12, 2015
1 parent 2132ef6 commit f5ea06f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/font_awesome/sass/rails/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ 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}"
content_class = "fa #{icon.split(" ").map { |icon| "fa-#{icon}" }.join(" ")}"
content_class << " #{html_options[:class]}" if html_options.key?(:class)
html_options[:class] = content_class

Expand Down

0 comments on commit f5ea06f

Please sign in to comment.