Module: Www::FaqHelper
- Defined in:
- app/helpers/www/faq_helper.rb
Overview
View helper: faq.
Instance Method Summary collapse
- #faq_index_breadcrumb(product_line) ⇒ Object
- #faq_show_breadcrumb(item) ⇒ Object
-
#retrieve_faqs(support: nil, sales: nil, tags: nil, add_vote_data: true, item: nil, product_line: nil) ⇒ Array<Article>
Convenience method to retrieve FAQs, sorted by popularity (votes) by default.
Instance Method Details
#faq_index_breadcrumb(product_line) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'app/helpers/www/faq_helper.rb', line 4 def (product_line) links = (product_line) if product_line.level > 0 faq_url = catalog_link(product_line, section: :faqs) links << { name: "#{product_line.display_name} FAQs", url: faq_url } if faq_url end (links) end |
#faq_show_breadcrumb(item) ⇒ Object
13 14 15 16 17 |
# File 'app/helpers/www/faq_helper.rb', line 13 def (item) links = item.primary_product_line ? (item.primary_product_line) : [] links << { name: 'FAQs' } (links) end |
#retrieve_faqs(support: nil, sales: nil, tags: nil, add_vote_data: true, item: nil, product_line: nil) ⇒ Array<Article>
Convenience method to retrieve FAQs, sorted by popularity (votes) by default
28 29 30 31 32 33 34 35 |
# File 'app/helpers/www/faq_helper.rb', line 28 def retrieve_faqs(support: nil, sales: nil, tags: nil, add_vote_data: true, item: nil, product_line: nil) Item::ArticleRetriever.new( article_types: %w[faq], add_vote_data: add_vote_data, support: support, sales: sales ).process(product_line: product_line, item: item, tags: ).articles end |