module FontAwesome
  module Sass
    module Rails
      module ViewHelpers
        def icon(icon, text="", html_options={})
          content_class = "fa fa-#{icon}"
          content_class << " #{html_options[:class]}" if html_options.key?(:class)
          html_options[:class] = content_class

          html = content_tag(:i, nil, html_options)
          html << " #{text}" unless text.blank?
          html.html_safe
        end
      end
    end
  end
end

module FontAwesome
  module Sass
    module Rails
      module ViewHelpers
        def icon(icon, *args)
          text, html_options = args
          html_options = text if text.is_a?(Hash)
          
          content_class = "fa fa-#{icon}"
          content_class << " #{html_options[:class]}" if html_options.key?(:class)
          html_options[:class] = content_class

          html = content_tag(:i, nil, html_options)
          html << " #{text}" unless text.blank?
          html.html_safe
        end
      end
    end
  end
end

Change icon helper input params
Change icon helper input params

Before:
```ruby
<%= icon :spinner, nil, class: "fa-spin" %>
#=> <i class="fa fa-spinner fa-spin"></i>

<%= icon :spinner, "Loading", class: "fa-spin" %>
#=> <i class="fa fa-spinner fa-spin">Loading</i>
```
After
```ruby
<%= icon :spinner, class: "fa-spin" %>
#=> <i class="fa fa-spinner fa-spin"></i>

<%= icon :spinner, "Loading", class: "fa-spin" %>
#=> <i class="fa fa-spinner fa-spin">Loading</i>
```