Sha256: 3aa623b96a959e396967dc069b3cfbbce73b1110c3fbaca28c200390c46238bd

Contents?: true

Size: 602 Bytes

Versions: 8

Compression:

Stored size: 602 Bytes

Contents

module Pageflow
  class FilesController < Pageflow::ApplicationController
    before_filter :prevent_ssl

    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

8 entries across 8 versions & 1 rubygems

Version Path
pageflow-0.8.2 app/controllers/pageflow/files_controller.rb
pageflow-0.8.1 app/controllers/pageflow/files_controller.rb
pageflow-0.8.0 app/controllers/pageflow/files_controller.rb
pageflow-0.7.2 app/controllers/pageflow/files_controller.rb
pageflow-0.7.1 app/controllers/pageflow/files_controller.rb
pageflow-0.7.0 app/controllers/pageflow/files_controller.rb
pageflow-0.6.0 app/controllers/pageflow/files_controller.rb
pageflow-0.5.0 app/controllers/pageflow/files_controller.rb