Class: Lookbook::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/lookbook/application_controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.controller_pathObject



14
15
16
# File 'app/controllers/lookbook/application_controller.rb', line 14

def self.controller_path
  "lookbook"
end

Instance Method Details

#indexObject



18
19
20
21
22
23
24
25
# File 'app/controllers/lookbook/application_controller.rb', line 18

def index
  landing = Lookbook.pages.find(&:landing?) || Lookbook.pages.first
  if landing.present?
    redirect_to lookbook_page_path(landing.path)
  else
    render "lookbook/index"
  end
end