Standardize links to wiki help pages.

* Fix inconsistencies in how wiki pages were linked.

* Link directly to the wiki instead of to a title search that is expected
  to redirect to the wiki.
This commit is contained in:
evazion
2019-10-31 02:44:08 -05:00
parent a8fc2ba508
commit 5422db1c3c
31 changed files with 60 additions and 56 deletions

View File

@@ -103,9 +103,13 @@ module ApplicationHelper
link_to search, posts_path(tags: search)
end
def link_to_wiki(*wiki_titles, **options)
def link_to_wiki(text, title)
link_to text, wiki_page_path(title)
end
def link_to_wikis(*wiki_titles, last_word_connector: ", or", **options)
links = wiki_titles.map do |title|
link_to title.tr("_", " "), wiki_pages_path(title: title)
link_to title.tr("_", " "), wiki_page_path(title)
end
to_sentence(links, **options)