Module: Spree::Core::ControllerHelpers::CommonDecorator

Defined in:
app/decorators/helpers/spree/core/controller_helpers/common_decorator.rb

Class Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/decorators/helpers/spree/core/controller_helpers/common_decorator.rb', line 5

def self.prepended(base)
  base.module_eval do
    attr_reader :custom_title

    def title
      custom_title || current_store.seo_tagline
    end

    def custom_title
      @title.presence || accurate_title.presence
    end

    def accurate_title
      # No default accurate_title (controller-level SEO title)
      # so we can detect when there's no seo title defined,
      # make it fallback to Spree::Store#seo_tagline
      # field and then reverse the title output in
      # SolidusSeo::MetaDataBuilder#set_meta_data
    end
  end
end