Module: Refinery::TagHelper
- Includes:
- ActionHelper
- Defined in:
- app/helpers/refinery/tag_helper.rb
Instance Method Summary collapse
-
#refinery_help_tag(title = 'Tip') ⇒ Object
Remember to wrap your block with <span class=‘label_with_help’></span> if you’re using a label next to the help tag.
-
#refinery_icon_tag(filename, options = {}) ⇒ Object
This is just a quick wrapper to render an image tag that lives inside refinery/icons.
Methods included from ActionHelper
#action_icon, #action_icon_label, #action_label, #edit_in_current_locale, #edit_in_locale, #edit_in_locales, #i18n_scope, #locale_language
Instance Method Details
#refinery_help_tag(title = 'Tip') ⇒ Object
Remember to wrap your block with <span class=‘label_with_help’></span> if you’re using a label next to the help tag.
8 9 10 11 |
# File 'app/helpers/refinery/tag_helper.rb', line 8 def refinery_help_tag(title='Tip') title = title.html_safe? ? title : h(title) action_icon(:info, '#', title, {tooltip: title}) end |
#refinery_icon_tag(filename, options = {}) ⇒ Object
This is just a quick wrapper to render an image tag that lives inside refinery/icons. They are all 16x16 so this is the default but is able to be overriden with supplied options.
15 16 17 18 19 20 21 |
# File 'app/helpers/refinery/tag_helper.rb', line 15 def refinery_icon_tag(filename, = {}) Refinery.deprecate('Refinery::TagHelper.refinery_icon_tag', when: '5.1', replacement: 'Refinery::ActionHelper.action_icon') filename = "#{filename}.png" unless filename.split('.').many? path = image_path "refinery/icons/#{filename}", skip_pipeline: true image_tag path, {width: 16, height: 16}.merge() end |