From e38a7742f0a7e93c32b51fa6f64071da7f524179 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Sun, 6 Jul 2014 22:29:19 +0200 Subject: [PATCH] wire up downloading attachments from todo partial --- app/controllers/todos_controller.rb | 2 +- config/routes.rb | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/todos_controller.rb b/app/controllers/todos_controller.rb index c7e1c285..cb63e2b9 100644 --- a/app/controllers/todos_controller.rb +++ b/app/controllers/todos_controller.rb @@ -817,7 +817,7 @@ class TodosController < ApplicationController def attachment id = params[:id] filename = params[:filename] - attachment = current_user.attachments.find(id) + attachment = Attachment.where(id: id).first if attachment send_file(attachment.file.path, diff --git a/config/routes.rb b/config/routes.rb index 71b5b1e4..02cdb3de 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -90,7 +90,6 @@ Rails.application.routes.draw do get 'convert_to_project' # TODO: convert to PUT/POST delete 'remove_predecessor' # TODO: convert to PUT/POST post 'change_context' - get 'attachment' end collection do get 'done'