Class: Www::SupportPageHeaderComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Www::SupportPageHeaderComponent
- Defined in:
- app/components/www/support_page_header_component.rb
Overview
ViewComponent: renders the support page header block.
Instance Method Summary collapse
-
#before_render ⇒ void
Ensure pages using this header get a sensible default og:image.
- #initialize(title:, sku:, introduction:, image_asset_id:, side_links: []) ⇒ void constructor
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(title:, sku:, introduction:, image_asset_id:, side_links: []) ⇒ void
10 11 12 13 14 15 16 17 |
# File 'app/components/www/support_page_header_component.rb', line 10 def initialize(title:, sku:, introduction:, image_asset_id:, side_links: []) super() @title = title @sku = sku @introduction = introduction @image_asset_id = image_asset_id @side_links = side_links end |
Instance Method Details
#before_render ⇒ void
This method returns an undefined value.
Ensure pages using this header get a sensible default og:image.
21 22 23 24 |
# File 'app/components/www/support_page_header_component.rb', line 21 def before_render super helpers.page_og_image(@image_asset_id) if @image_asset_id.present? end |