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.15.4 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.15.3 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.15.2 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.15.1 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.14.0 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.13.0 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.12.7 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.12.6 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.12.5 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.12.4 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.12.3 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.12.2 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.12.1 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.12.0 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.11.3 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.11.2 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.11.1 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.11.0 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.10.2 app/controllers/pages_core/frontend/page_files_controller.rb
pages_core-3.10.1 app/controllers/pages_core/frontend/page_files_controller.rb