Sha256: 518debb0a2a4b7972c6bf0cfc581160e5fb3d812924dad1afddad22f1080185c

Contents?: true

Size: 525 Bytes

Versions: 28

Compression:

Stored size: 525 Bytes

Contents

# frozen_string_literal: true

module PagesCore
  module Frontend
    class PageFilesController < ::FrontendController
      include PagesCore::AttachmentsHelper

      before_action :find_page_file, only: %i[show]

      def show
        unless stale?(etag: @page_file, last_modified: @page_file.updated_at)
          return
        end

        redirect_to attachment_path(@page_file.attachment)
      end

      private

      def find_page_file
        @page_file = PageFile.find(params[:id])
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
pages_core-3.9.2 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.9.1 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.9.0 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.8.3 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.8.2 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.8.1 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.8.0 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.7.0 app/controllers/pages_core/frontend/page_files_controller.rb