app/controllers/lookbook/application_controller.rb in lookbook-1.0.4 vs app/controllers/lookbook/application_controller.rb in lookbook-1.0.5
- old
+ new
@@ -1,15 +1,19 @@
module Lookbook
class ApplicationController < ActionController::Base
- content_security_policy false, if: -> { Rails.env.development? }
+ 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
before_action :generate_theme_overrides
+ before_action :assign_collections
def self.controller_path
"lookbook"
end
@@ -24,9 +28,14 @@
protected
def generate_theme_overrides
@theme_overrides ||= Lookbook.theme.to_css
+ end
+
+ def assign_collections
+ @previews = Preview.all
+ @pages = Page.all
end
def feature_enabled?(feature)
Lookbook::Features.enabled?(feature)
end