3
4
5
6
7
8
9
10
11
12
13
|
# File 'app/helpers/dokno/application_helper.rb', line 3
def dokno_article_link(link_text = nil, slug: nil)
return "Dokno article slug is required" unless slug.present?
article = Article.find_by(slug: slug.strip)
article = ArticleSlug.find_by(slug: slug.strip)&.article if article.blank?
return "Dokno article slug '#{slug}' not found" if article.blank?
%Q(<a class="dokno-link" href="javascript:;" onclick="doknoOpenPanel('#{j article.slug}');">#{link_text.presence || article.title}</a>).html_safe
end
|