class WarpEngine::FilesController
Serves published files under /file.
Public Instance Methods
Source
# File app/controllers/warp_engine/files_controller.rb, line 22 def show result = WarpEngine::FileService.new.show( WarpEngine::FileShowInputDto.new(path: params[:path]), subject: current_subject ) case result.type when :redirect then redirect_to result.url, status: :moved_permanently when :file then send_file result.path, disposition: "inline", type: resolve_mime(result.path) when :not_found then head :not_found end end
GET /file/*path.
Resolves the path through WarpEngine::FileService, which applies the access policy. Sends the file inline; redirects (301) a folder to its index.html and a file of a non-local storage adapter to its storage URL; responds 404 when there is no such file or folder index. A refused caller gets 403.