Sha256: e18dc189d9bd739ed040396b8fa2bf9fe6f721133c5e13e0fa6a0f4a1351b56f

Contents?: true

Size: 756 Bytes

Versions: 1

Compression:

Stored size: 756 Bytes

Contents

module Lookbook
  class ApplicationController < ActionController::Base
    if respond_to?(:content_security_policy)
      content_security_policy false, if: -> { Rails.env.development? }
    end

    protect_from_forgery with: :exception

    helper Lookbook::ApplicationHelper
    helper Lookbook::OutputHelper
    helper Lookbook::ComponentHelper

    def self.controller_path
      "lookbook"
    end

    def index
      if feature_enabled? :pages
        landing = Lookbook.pages.find(&:landing) || Lookbook.pages.first
        if landing.present?
          redirect_to lookbook_page_path(landing.lookup_path)
        end
      end
    end

    protected

    def feature_enabled?(feature)
      Lookbook::Features.enabled?(feature)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lookbook-0.9.8 app/controllers/lookbook/application_controller.rb