Module: RailsBootstrapHelpers::Helpers::BaseHelper
- Includes:
- OptionsHelper
- Included in:
- Renderers::ButtonRenderer
- Defined in:
- lib/rails-bootstrap-helpers/helpers/base_helper.rb
Instance Method Summary collapse
-
#icon(icon, options = {}) ⇒ Object
Renders the given icon.
-
#iconic_icon(icon, options = {}) ⇒ Object
Renders the given Iconic icon.
Methods included from OptionsHelper
Instance Method Details
#icon(icon, options = {}) ⇒ Object
Renders the given icon
Renders an i tag with the class “icon-##icon”
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rails-bootstrap-helpers/helpers/base_helper.rb', line 11 def icon (icon, = {}) = .dup icon = ERB::Util.html_escape(icon.to_s) append_class!(, "icon-" + icon) if .delete(:invert) append_class!(, "icon-white") end cls = [:class] "<i class=\"#{cls}\"></i>".html_safe end |
#iconic_icon(icon, options = {}) ⇒ Object
Renders the given Iconic icon.
This is the Iconic icons from Jasny Bootstrap. Renders an i tag with the class “iconic-##icon”
41 42 43 |
# File 'lib/rails-bootstrap-helpers/helpers/base_helper.rb', line 41 def iconic_icon (icon, = {}) RailsBootstrapHelpers::Renderers::IconicIconRenderer.new(self, icon, ).render end |