Skip to content

Commit 61d888d

Browse files
committed
fill in delete path for upload
1 parent fd186cf commit 61d888d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/models/upload.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
class Upload < ActiveRecord::Base
22
attr_accessible :upload
3-
43
has_attached_file :upload
54

5+
include Rails.application.routes.url_helpers
6+
67
def to_jq_upload
78
{
89
"name" => read_attribute(:upload_file_name),
910
"size" => read_attribute(:upload_file_size),
1011
"url" => upload.url(:original),
11-
"delete_url" => '',
12+
"delete_url" => upload_path(self),
1213
"delete_type" => "DELETE"
1314
}
1415
end

0 commit comments

Comments
 (0)