Class: Www::BlogFaqItemComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Www::BlogFaqItemComponent
- Defined in:
- app/components/www/blog_faq_item_component.rb
Overview
Simple card-style FAQ item for use in blog posts via the faq % liquid tag.
Unlike FaqItemComponent (accordion style), this renders as a static card.
Instance Method Summary collapse
-
#initialize(article_faq:, preview_mode: false) ⇒ BlogFaqItemComponent
constructor
A new instance of BlogFaqItemComponent.
- #render? ⇒ Boolean
Methods inherited from ApplicationComponent
#cms_link, #fetch_or_fallback, #image_asset_tag, #image_tag, #number_to_currency, #number_with_delimiter, #post_path, #post_url, #strip_tags
Constructor Details
#initialize(article_faq:, preview_mode: false) ⇒ BlogFaqItemComponent
Returns a new instance of BlogFaqItemComponent.
8 9 10 11 12 |
# File 'app/components/www/blog_faq_item_component.rb', line 8 def initialize(article_faq:, preview_mode: false) super() @article_faq = article_faq @preview_mode = preview_mode end |
Instance Method Details
#render? ⇒ Boolean
14 15 16 |
# File 'app/components/www/blog_faq_item_component.rb', line 14 def render? @article_faq.present? end |