Module: GenericFormFor::Actions::Base::Icon
- Defined in:
- lib/generic_form_for/actions/base/icon.rb
Instance Method Summary collapse
- #icon_html(config_options = {}) ⇒ Object
- #icon_html_options(config_options = {}) ⇒ Object
- #render_icon? ⇒ Boolean
Instance Method Details
#icon_html(config_options = {}) ⇒ Object
6 7 8 9 |
# File 'lib/generic_form_for/actions/base/icon.rb', line 6 def icon_html(={}) return "" unless render_icon? template.content_tag(.delete(:tag) || :span, "", ()) end |
#icon_html_options(config_options = {}) ⇒ Object
11 12 13 14 15 |
# File 'lib/generic_form_for/actions/base/icon.rb', line 11 def (={}) opts = ([:icon_html] || {}).dup opts[:class] = [*[:icon], *opts[:class], *[:class]].compact.join(' ').strip .merge(opts) end |
#render_icon? ⇒ Boolean
17 18 19 |
# File 'lib/generic_form_for/actions/base/icon.rb', line 17 def render_icon? .key?(:icon) end |