mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-12 18:34:22 +01:00
wire up downloading attachments from todo partial
This commit is contained in:
parent
2fe0425ce9
commit
c49296e843
3 changed files with 9 additions and 2 deletions
|
|
@ -819,7 +819,7 @@ class TodosController < ApplicationController
|
|||
filename = params[:filename]
|
||||
attachment = current_user.attachments.find(id)
|
||||
|
||||
if attachment
|
||||
if attachment
|
||||
send_file(attachment.file.path,
|
||||
disposition: 'attachment',
|
||||
type: 'message/rfc822')
|
||||
|
|
|
|||
|
|
@ -212,6 +212,14 @@ module TodosHelper
|
|||
)
|
||||
end
|
||||
|
||||
def attachment_image(todo)
|
||||
link_to(
|
||||
image_tag('blank.png', width: 16, height: 16, border:0),
|
||||
todo.attachments.first.file.url,
|
||||
{:class => 'todo_attachment', title: 'Get attachments of this todo'}
|
||||
)
|
||||
end
|
||||
|
||||
def collapsed_notes_image(todo)
|
||||
link = link_to(
|
||||
image_tag( 'blank.png', :width=>'16', :height=>'16', :border=>'0' ),
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue