forked from fixin.me/fixin.me
Do not display application menu links with current url
Add "Recover password" link
This commit is contained in:
@@ -32,12 +32,9 @@ module ApplicationHelper
|
||||
end
|
||||
|
||||
def image_link_to(name, image = nil, options = nil, html_options = nil)
|
||||
return "" if html_options.delete(:unless_current) && (url_for(options) == request.path)
|
||||
|
||||
name = svg_tag("pictograms/#{image}.svg#icon") + name if image
|
||||
if html_options.delete(:hide)
|
||||
# NOTE: current_path? does not work for POST
|
||||
visibility = (url_for(options) == request.path) ? 'hidden' : 'visible'
|
||||
html_options.merge!(style: "visibility: #{visibility}") { |k, v1, v2| v1 + v2 }
|
||||
end
|
||||
link_to name, options, html_options
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user