Skip to content

Commit

Permalink
Added class option to icon_tag to accept any custom classes you want …
Browse files Browse the repository at this point in the history
…to throw at it.
  • Loading branch information
joshuapinter committed Mar 28, 2012
1 parent 6126811 commit ff83912
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bootstrap_helper.rb
Expand Up @@ -20,7 +20,9 @@ module RailsBootstrapHelpers::BootstrapHelper
# with 'icon-' if not done already. # with 'icon-' if not done already.
# @param [Hash] options # @param [Hash] options
# #
# @option options [Boolean] white (false) Set to false if you want to use the black icon. # @option options [Boolean] white (false) Set to true if you want a white icon.
# @option options [String] class ('') Set any classes you want for the icon here.
# a bit nicer.
# #
# @return [HTML] # @return [HTML]
# #
Expand All @@ -33,6 +35,7 @@ def icon_tag name, options = {}


klass = [name] klass = [name]
klass << 'icon-white' if options[:white] klass << 'icon-white' if options[:white]
klass << options[:class]


content_tag :i, nil, class: klass.join( ' ' ) content_tag :i, nil, class: klass.join( ' ' )
end end
Expand Down

0 comments on commit ff83912

Please sign in to comment.