module Spree::Core::ControllerHelpers::Common

Public Instance Methods

accurate_title() click to toggle source

this is a hook for subclasses to provide title

# File lib/spree/core/controller_helpers/common.rb, line 37
def accurate_title
  current_store.seo_title
end
default_title() click to toggle source
# File lib/spree/core/controller_helpers/common.rb, line 32
def default_title
  current_store.name
end
get_layout() click to toggle source

Returns which layout to render.

You can set the layout you want to render inside your Spree configuration with the :layout option.

Default layout is: app/views/spree/layouts/spree_application

# File lib/spree/core/controller_helpers/common.rb, line 58
def get_layout
  layout ||= Spree::Config[:layout]
end
set_user_language() click to toggle source
# File lib/spree/core/controller_helpers/common.rb, line 43
          def set_user_language
            ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
              ControllerHelpers::Common#set_user_language is deprecated and will be removed in Spree 5.0.
              Please use `before_action :set_locale` instead
            DEPRECATION

            set_locale
          end
title() click to toggle source
# File lib/spree/core/controller_helpers/common.rb, line 19
def title
  title_string = @title.present? ? @title : accurate_title
  if title_string.present?
    if Spree::Config[:always_put_site_name_in_title]
      [title_string, default_title].join(" #{Spree::Config[:title_site_name_separator]} ")
    else
      title_string
    end
  else
    default_title
  end
end