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(‘check’, class: ‘big-4’) icon(‘check’, class: ‘small-3’).
- #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
43 44 45 |
# File 'app/helpers/effective_icons_helper.rb', line 43 def approve_icon_to(path, = {}) icon_to('ok', path, { title: 'Approve' }.merge()) end |
#destroy_icon_to(path, options = {}) ⇒ Object
30 31 32 33 |
# File 'app/helpers/effective_icons_helper.rb', line 30 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
26 27 28 |
# File 'app/helpers/effective_icons_helper.rb', line 26 def edit_icon_to(path, = {}) icon_to('edit', path, { title: 'Edit' }.merge()) end |
#icon(svg, options = {}) ⇒ Object
icon(‘check’, class: ‘big-4’) icon(‘check’, class: ‘small-3’)
5 6 7 8 9 10 11 12 |
# File 'app/helpers/effective_icons_helper.rb', line 5 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
14 15 16 |
# File 'app/helpers/effective_icons_helper.rb', line 14 def icon_to(svg, url, = {}) link_to(icon(svg), url, ) end |
#new_icon_to(path, options = {}) ⇒ Object
18 19 20 |
# File 'app/helpers/effective_icons_helper.rb', line 18 def new_icon_to(path, = {}) icon_to('plus', path, { title: 'New' }.merge()) end |
#ok_icon_to(path, options = {}) ⇒ Object
39 40 41 |
# File 'app/helpers/effective_icons_helper.rb', line 39 def ok_icon_to(path, = {}) icon_to('ok', path, { title: 'OK' }.merge()) end |
#remove_icon_to(path, options = {}) ⇒ Object
47 48 49 |
# File 'app/helpers/effective_icons_helper.rb', line 47 def remove_icon_to(path, = {}) icon_to('remove', path, { title: 'Remove' }.merge()) end |
#settings_icon_to(path, options = {}) ⇒ Object
35 36 37 |
# File 'app/helpers/effective_icons_helper.rb', line 35 def settings_icon_to(path, = {}) icon_to('cog', path, { title: 'Settings' }.merge()) end |
#show_icon_to(path, options = {}) ⇒ Object
22 23 24 |
# File 'app/helpers/effective_icons_helper.rb', line 22 def show_icon_to(path, = {}) icon_to('eye', path, { title: 'Show' }.merge()) end |