Do not display application menu links with current url

Add "Recover password" link
This commit is contained in:
2023-04-13 01:48:47 +02:00
parent 3f2a92a6e5
commit 17e3f2e100
5 changed files with 8 additions and 11 deletions

View File

@@ -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