Class: Crm::SeoDashboardComponent

Inherits:
ApplicationComponent show all
Includes:
ActionView::Helpers::NumberHelper
Defined in:
app/components/crm/seo_dashboard_component.rb

Overview

Displays SEO metrics and analysis for a SiteMap record.
Reusable component for blog posts, products, and other content types.

Examples:

Basic usage

render Crm::SeoDashboardComponent.new(site_map: @post.site_map)

With analysis trigger

render Crm::SeoDashboardComponent.new(
  site_map: @product.site_map,
  show_analyze_button: true
)

Instance Method Summary collapse

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(site_map:, show_analyze_button: true) ⇒ SeoDashboardComponent

Returns a new instance of SeoDashboardComponent.



19
20
21
22
23
# File 'app/components/crm/seo_dashboard_component.rb', line 19

def initialize(site_map:, show_analyze_button: true)
  super()
  @site_map = site_map
  @show_analyze_button = show_analyze_button
end

Instance Method Details

#render?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'app/components/crm/seo_dashboard_component.rb', line 25

def render?
  @site_map.present?
end