Sha256: cfa412b857a9e333176a2ef81e3e25b63cff986b061b1243679e873dbd24924b

Contents?: true

Size: 731 Bytes

Versions: 38

Compression:

Stored size: 731 Bytes

Contents

module Pageflow
  class FilesController < Pageflow::ApplicationController
    include PublicHttpsMode
    include EntryPasswordProtection

    before_action :check_public_https_mode

    def show
      respond_to do |format|
        format.html do
          @entry = PublishedEntry.find(params[:entry_id], entry_request_scope)
          @file = @entry.find_file(file_type.model, params[:id])

          check_entry_password_protection(@entry)
        end
      end
    end

    protected

    def file_type
      @file_type ||= Pageflow.config.file_types.find_by_collection_name!(params[:collection_name])
    end

    def entry_request_scope
      Pageflow.config.public_entry_request_scope.call(Entry, request)
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
pageflow-17.0.4 app/controllers/pageflow/files_controller.rb
pageflow-17.0.3 app/controllers/pageflow/files_controller.rb
pageflow-17.0.2 app/controllers/pageflow/files_controller.rb
pageflow-17.0.1 app/controllers/pageflow/files_controller.rb
pageflow-17.0.0 app/controllers/pageflow/files_controller.rb
pageflow-16.2.0 app/controllers/pageflow/files_controller.rb
pageflow-16.1.0 app/controllers/pageflow/files_controller.rb
pageflow-16.0.0 app/controllers/pageflow/files_controller.rb
pageflow-15.8.0 app/controllers/pageflow/files_controller.rb
pageflow-15.7.1 app/controllers/pageflow/files_controller.rb
pageflow-15.7.0 app/controllers/pageflow/files_controller.rb
pageflow-15.6.1 app/controllers/pageflow/files_controller.rb
pageflow-15.6.0 app/controllers/pageflow/files_controller.rb
pageflow-15.5.0 app/controllers/pageflow/files_controller.rb
pageflow-15.4.0 app/controllers/pageflow/files_controller.rb
pageflow-15.3.0 app/controllers/pageflow/files_controller.rb
pageflow-15.2.2 app/controllers/pageflow/files_controller.rb
pageflow-15.2.1 app/controllers/pageflow/files_controller.rb
pageflow-15.2.0 app/controllers/pageflow/files_controller.rb
pageflow-15.1.2 app/controllers/pageflow/files_controller.rb