diff options
author | Sebastian Klier <sebastian@sebastianklier.com> | 2016-04-05 08:36:09 +0300 |
---|---|---|
committer | Sebastian Klier <sebastian@sebastianklier.com> | 2016-04-20 03:25:41 +0300 |
commit | a88f0a1fd8fc150432729f525f1c2cecde93301a (patch) | |
tree | 1d4298773bbb37c867fc222832b473d8b158de32 /lib | |
parent | 559ef41d32db10b79fe7b6cfa42b8cd019ca8415 (diff) |
add wiki_page helper to url_builder
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/url_builder.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gitlab/url_builder.rb b/lib/gitlab/url_builder.rb index f1943222edf..2bbbd3074e8 100644 --- a/lib/gitlab/url_builder.rb +++ b/lib/gitlab/url_builder.rb @@ -20,6 +20,8 @@ module Gitlab merge_request_url(object) when Note note_url + when WikiPage + wiki_page_url else raise NotImplementedError.new("No URL builder defined for #{object.class}") end @@ -58,5 +60,9 @@ module Gitlab project_snippet_url(snippet, anchor: dom_id(object)) end end + + def wiki_page_url + "#{Gitlab.config.gitlab.url}#{object.wiki.wiki_base_path}/#{object.slug}" + end end end |