Class: Spree::HomeController

Inherits:
StoreController show all
Includes:
CacheHelper
Defined in:
app/controllers/spree/home_controller.rb

Instance Method Summary collapse

Methods included from CacheHelper

#http_cache_enabled?

Methods inherited from StoreController

#account_link, #api_tokens, #cart_link, #ensure_cart

Instance Method Details

#indexObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/spree/home_controller.rb', line 9

def index
  if @cms_home_page&.visible?
    @homepage = @cms_home_page
  elsif try_spree_current_user&.admin?
    @homepage = @cms_home_page
    @edit_mode = true
  end

  if http_cache_enabled?
    fresh_when etag: store_etag, last_modified: last_modified_index, public: true
  end
end