Class: Lookbook::ApplicationController

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

Direct Known Subclasses

PagesController, PreviewsController

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.controller_pathObject



16
17
18
# File 'app/controllers/lookbook/application_controller.rb', line 16

def self.controller_path
  "lookbook"
end

Instance Method Details

#indexObject



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

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