Class: Www::ProductShowcaseComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Www::ProductShowcaseComponent
- Includes:
- ActionView::Helpers::TagHelper, ActionView::Helpers::UrlHelper
- Defined in:
- app/components/www/product_showcase_component.rb
Overview
ProductShowcaseComponent - Displays a showcase project on a product page
Designed to look good even with a single showcase, featuring:
- Main image with overlay information
- Location and room type badges
- Optional operating cost display
- Call-to-action to view full showcase
Instance Method Summary collapse
-
#initialize(showcase:, product_name: nil) ⇒ ProductShowcaseComponent
constructor
A new instance of ProductShowcaseComponent.
- #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(showcase:, product_name: nil) ⇒ ProductShowcaseComponent
Returns a new instance of ProductShowcaseComponent.
26 27 28 29 30 |
# File 'app/components/www/product_showcase_component.rb', line 26 def initialize(showcase:, product_name: nil) super() @showcase = showcase @product_name = product_name end |
Instance Method Details
#render? ⇒ Boolean
32 33 34 |
# File 'app/components/www/product_showcase_component.rb', line 32 def render? showcase.present? && showcase.main_image.present? end |