Module: Www::FaqHelper
- Defined in:
- app/helpers/www/faq_helper.rb
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
2 3 4 5 6 7 8 9 |
# File 'app/helpers/www/faq_helper.rb', line 2 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
11 12 13 14 15 |
# File 'app/helpers/www/faq_helper.rb', line 11 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
26 27 28 29 30 31 32 33 |
# File 'app/helpers/www/faq_helper.rb', line 26 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 |