Sha256: d8a72c751a8c0c2cec12441dfa4da85587e9b1bba55d1bd66bd59a4dc3182e1d

Contents?: true

Size: 643 Bytes

Versions: 3

Compression:

Stored size: 643 Bytes

Contents

module Pageflow
  class FilesController < Pageflow::ApplicationController
    include PublicHttpsMode

    before_filter :check_public_https_mode

    def show
      respond_to do |format|
        format.html do
          entry = PublishedEntry.find(params[:entry_id], entry_request_scope)
          @file = entry.files(file_type.model).find(params[:id])
        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

3 entries across 3 versions & 1 rubygems

Version Path
pageflow-0.9.2 app/controllers/pageflow/files_controller.rb
pageflow-0.9.1 app/controllers/pageflow/files_controller.rb
pageflow-0.9.0 app/controllers/pageflow/files_controller.rb