forked from fixin.me/fixin.me
Add navigation menu
This commit is contained in:
@@ -45,10 +45,12 @@ module ApplicationHelper
|
||||
end
|
||||
|
||||
def image_link_to(name, image = nil, options = nil, html_options = {})
|
||||
return "" if html_options.delete(:unless_current) && (url_for(options) == request.path)
|
||||
current = html_options.delete(:current)
|
||||
return "" if (current == :hide) && (url_for(options) == request.path)
|
||||
|
||||
classes = class_names(html_options[:class], "image-button", active: current == :active)
|
||||
name = svg_tag("pictograms/#{image}.svg#icon") + name if image
|
||||
link_to name, options, html_options.merge!(class: "image-button") { |k, v1, v2| "#{v1} #{v2}" }
|
||||
link_to name, options, class: classes
|
||||
end
|
||||
|
||||
def svg_tag(source, options = {})
|
||||
|
||||
Reference in New Issue
Block a user