From c7cf3bb62a366966dd9c681de55984ec0bfc9939 Mon Sep 17 00:00:00 2001 From: eagletmt Date: Sat, 20 Oct 2012 04:44:31 +0900 Subject: [PATCH] Serve uploaded apks --- CutenServer/app/controllers/apks_controller.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CutenServer/app/controllers/apks_controller.rb b/CutenServer/app/controllers/apks_controller.rb index 663a94f..c46be4d 100644 --- a/CutenServer/app/controllers/apks_controller.rb +++ b/CutenServer/app/controllers/apks_controller.rb @@ -11,10 +11,8 @@ class ApksController < ApplicationController # GET /apks/1/download def download @apk = Apk.find params[:id] - project_name = @apk.name.match(/[^.]+\z/)[0] - apk_path = "#{Rails.root}/../#{project_name}/bin/#{project_name}-debug.apk" - if File.file? apk_path and File.readable? apk_path - send_file apk_path, :type => APK_MIME_TYPE + if File.file? @apk.path and File.readable? @apk.path + send_file @apk.path, :type => APK_MIME_TYPE else head :not_found end -- 2.11.0