Project

General

Profile

« Previous | Next » 

Revision 9b6e45e9

Added by Lukas Zapletal over 10 years ago

fixes #3903 - fixed menu links when relative URLs are set

View differences:

app/services/menu/item.rb
end
def url
@context.routes.url_for(url_hash.merge(:only_path=>true))
add_relative_path(@context.routes.url_for(url_hash.merge(:only_path=>true)))
end
def url_hash
......
false
end
private
def add_relative_path(path)
rurl = @context.config.action_controller.relative_url_root
rurl.present? && !path.start_with?(rurl.end_with?('/') ? rurl : "#{rurl}/") ? "#{rurl}#{path}" : path
end
end
end

Also available in: Unified diff