Sha256: 51890e5a64bc8d9e07e2de01f37cab73550176ad7c66f52f48d8743c9166312b
Contents?: true
Size: 1.34 KB
Versions: 79
Compression:
Stored size: 1.34 KB
Contents
module EffectiveIconsHelper # icon('check', class: 'big-4') # icon('check', class: 'small-3') def icon(svg, options = {}) svg = svg.to_s.chomp('.svg') options.reverse_merge!(nocomment: true) options[:class] = [options[:class], "eb-icon eb-icon-#{svg}"].compact.join(' ') inline_svg_tag("icons/#{svg}.svg", options) end def icon_to(svg, url, options = {}) link_to(icon(svg), url, options) end def new_icon_to(path, options = {}) icon_to('plus', path, { title: 'New' }.merge(options)) end def show_icon_to(path, options = {}) icon_to('eye', path, { title: 'Show' }.merge(options)) end def edit_icon_to(path, options = {}) icon_to('edit', path, { title: 'Edit' }.merge(options)) end def destroy_icon_to(path, options = {}) defaults = { title: 'Destroy', data: { method: :delete, confirm: 'Delete this item?' } } icon_to('trash', path, defaults.merge(options)) end def settings_icon_to(path, options = {}) icon_to('cog', path, { title: 'Settings' }.merge(options)) end def ok_icon_to(path, options = {}) icon_to('ok', path, { title: 'OK' }.merge(options)) end def approve_icon_to(path, options = {}) icon_to('ok', path, { title: 'Approve' }.merge(options)) end def remove_icon_to(path, options = {}) icon_to('remove', path, { title: 'Remove' }.merge(options)) end end
Version data entries
79 entries across 79 versions & 1 rubygems