Module: QuickLinkHelper

Included in:
ActionView::Base
Defined in:
app/helpers/quick_link_helper.rb

Overview

On Pages, the main text is parsed for expressions like β€œ[[Foo Bar]]”. These expressions generate links to β€œ/search/guess?query=Foo+Bar”. The SearchController handles the redirection to the requested content.

This can be used to insert quick links to user, pages and other types of content.

Instance Method Summary collapse

Instance Method Details



11
12
13
# File 'app/helpers/quick_link_helper.rb', line 11

def replace_quick_link_tags(text)
  text.gsub(/\[\[.*\]\]/) { |query| link_tag_from_search_query(query.gsub('[', '').gsub(']', '')) } if text.present?
end