Module: EffectiveIconsHelper
- Defined in:
- app/helpers/effective_icons_helper.rb
Instance Method Summary collapse
- #approve_icon_to(path, options = {}) ⇒ Object
- #destroy_icon_to(path, options = {}) ⇒ Object
- #edit_icon_to(path, options = {}) ⇒ Object
- #icon(svg, options = {}) ⇒ Object
- #icon_to(svg, url, options = {}) ⇒ Object
- #new_icon_to(path, options = {}) ⇒ Object
- #ok_icon_to(path, options = {}) ⇒ Object
- #remove_icon_to(path, options = {}) ⇒ Object
- #settings_icon_to(path, options = {}) ⇒ Object
- #show_icon_to(path, options = {}) ⇒ Object
Instance Method Details
#approve_icon_to(path, options = {}) ⇒ Object
41 42 43 |
# File 'app/helpers/effective_icons_helper.rb', line 41 def approve_icon_to(path, = {}) icon_to('ok', path, { title: 'Approve' }.merge()) end |
#destroy_icon_to(path, options = {}) ⇒ Object
28 29 30 31 |
# File 'app/helpers/effective_icons_helper.rb', line 28 def destroy_icon_to(path, = {}) defaults = { title: 'Destroy', data: { method: :delete, confirm: 'Delete this item?' } } icon_to('trash', path, defaults.merge()) end |
#edit_icon_to(path, options = {}) ⇒ Object
24 25 26 |
# File 'app/helpers/effective_icons_helper.rb', line 24 def edit_icon_to(path, = {}) icon_to('edit', path, { title: 'Edit' }.merge()) end |
#icon(svg, options = {}) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'app/helpers/effective_icons_helper.rb', line 3 def icon(svg, = {}) svg = svg.to_s.chomp('.svg') .reverse_merge!(nocomment: true) [:class] = [[:class], "eb-icon eb-icon-#{svg}"].compact.join(' ') inline_svg("icons/#{svg}.svg", ) end |
#icon_to(svg, url, options = {}) ⇒ Object
12 13 14 |
# File 'app/helpers/effective_icons_helper.rb', line 12 def icon_to(svg, url, = {}) link_to(icon(svg), url, ) end |
#new_icon_to(path, options = {}) ⇒ Object
16 17 18 |
# File 'app/helpers/effective_icons_helper.rb', line 16 def new_icon_to(path, = {}) icon_to('plus', path, { title: 'New' }.merge()) end |
#ok_icon_to(path, options = {}) ⇒ Object
37 38 39 |
# File 'app/helpers/effective_icons_helper.rb', line 37 def ok_icon_to(path, = {}) icon_to('ok', path, { title: 'OK' }.merge()) end |
#remove_icon_to(path, options = {}) ⇒ Object
45 46 47 |
# File 'app/helpers/effective_icons_helper.rb', line 45 def remove_icon_to(path, = {}) icon_to('remove', path, { title: 'Remove' }.merge()) end |
#settings_icon_to(path, options = {}) ⇒ Object
33 34 35 |
# File 'app/helpers/effective_icons_helper.rb', line 33 def settings_icon_to(path, = {}) icon_to('cog', path, { title: 'Settings' }.merge()) end |
#show_icon_to(path, options = {}) ⇒ Object
20 21 22 |
# File 'app/helpers/effective_icons_helper.rb', line 20 def show_icon_to(path, = {}) icon_to('eye', path, { title: 'Show' }.merge()) end |