Sha256: 4f34988176a091d69f3ad12f92d1e74c57c8208fb267ae9fa633c276409d129d

Contents?: true

Size: 683 Bytes

Versions: 5

Compression:

Stored size: 683 Bytes

Contents

module Pageflow
  module Vr
    class StaticFilesController < ActionController::Base
      after_action :allow_iframe, only: :vrview

      # By default Rails only allows XHR requests with js content type
      # (see docs of
      # `ActionController::RequestForgeryProtection`). This controller
      # serves static assets, though. Allow using its endpoint in
      # `<script>` tags.
      protect_from_forgery except: :vrview

      def vrview
        respond_to do |format|
          format.html
          format.css
          format.js
        end
      end

      private

      def allow_iframe
        response.headers.except! 'X-Frame-Options'
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pageflow-vr-1.5.0 app/controllers/pageflow/vr/static_files_controller.rb
pageflow-vr-1.4.0 app/controllers/pageflow/vr/static_files_controller.rb
pageflow-vr-1.3.0 app/controllers/pageflow/vr/static_files_controller.rb
pageflow-vr-1.2.0 app/controllers/pageflow/vr/static_files_controller.rb
pageflow-vr-1.1.0 app/controllers/pageflow/vr/static_files_controller.rb