Added new icon helper
This commit is contained in:
@@ -4,10 +4,17 @@ module ApplicationHelper
|
||||
options[:aria] = true
|
||||
options[:nocomment] = true
|
||||
options[:variant] ||= :outline
|
||||
#options[:class] = options.fetch(:class, nil)
|
||||
# options[:class] = options.fetch(:class, nil)
|
||||
options[:class] = "size-5" unless options[:class]
|
||||
path = options.fetch(:path, "icons/#{options[:variant]}/#{name}.svg")
|
||||
icon = path
|
||||
inline_svg_tag(icon, options)
|
||||
end
|
||||
|
||||
def bool_icon(bool)
|
||||
case bool
|
||||
when true then "check"
|
||||
else "x-mark"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user