Revision 9b6e45e9
Added by Lukas Zapletal over 10 years ago
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
fixes #3903 - fixed menu links when relative URLs are set