You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: preview_controller.rb
    path of file: ./repos/lookbook/app/controllers/lookbook
    
    the code of the file until where you have to start completion: require "rails/application_controller"

module Lookbook
  class PreviewController < Rails::ApplicationController
    content_security_policy(false) if respond_to?(:content_security_policy)

    private

    def set_locale(&block)
      I18n.with_locale(param
    
    def determine_layout(layout_override = nil, prepend_views: true)
      return {} unless defined?(Rails.root)

      layout_declaration = {}

      if !layout_override.nil?
        # Allow component-level override, even if false (thus no layout rendered)
        layout_declaration[:layout] = layout_override
      elsif default_preview_layout.present?
        layout_declaration[:layout] = default_preview_layout
      end