file_upload 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e56842a2d4b0772171a482a056a51a38262be865
|
4
|
+
data.tar.gz: 806c5bbb78d458ca6f278fd72185de3c22d58045
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c351757c72710f7ebbca938b5220ec0fabef8f17f6308bdea434b6961bebb313707295d1aadecbb662eb1ad1cc6d57dc413da890f45635c6422989f44f5add9
|
7
|
+
data.tar.gz: c6a81e17a703c54b7ab5982a9659198bad4a692d6751ed2a6dbd73ded9c205fac6b512c5427dcb7bc10889029b7fd6fa5b2228655b9b706de19452483c4956a8
|
@@ -58,11 +58,11 @@ $(function() {
|
|
58
58
|
item.find(".progress").replaceWith(
|
59
59
|
$('<input type="checkbox" checked="checked"/>')
|
60
60
|
.attr('name', inputName.replace("REPLACE_ID", Math.floor(Math.random() * 1000000)))
|
61
|
-
.val(file
|
61
|
+
.val(file['id'])
|
62
62
|
);
|
63
63
|
} else {
|
64
64
|
// add key hidden field
|
65
|
-
container.find(".inputs .progress").replaceWith('<input type="hidden" name="' + inputName + '" value="' + file
|
65
|
+
container.find(".inputs .progress").replaceWith('<input type="hidden" name="' + inputName + '" value="' + file['id'] + '"/><input type="checkbox" checked="checked" name="' + inputPrefix + "[_destroy]" + '" value="0"/>');
|
66
66
|
}
|
67
67
|
});
|
68
68
|
|
@@ -18,6 +18,12 @@ class FileUpload::RedisFilesController < ApplicationController
|
|
18
18
|
|
19
19
|
def show
|
20
20
|
@redis_file = FileUpload::RedisFile.find(params[:id])
|
21
|
+
respond_to do |format|
|
22
|
+
format.json {
|
23
|
+
render json: @redis_file.to_json
|
24
|
+
}
|
25
|
+
format.html
|
26
|
+
end
|
21
27
|
end
|
22
28
|
|
23
29
|
def preview
|
@@ -28,6 +34,14 @@ class FileUpload::RedisFilesController < ApplicationController
|
|
28
34
|
def destroy
|
29
35
|
@redis_file = FileUpload::RedisFile.find(params[:id])
|
30
36
|
@redis_file.destroy
|
37
|
+
respond_to do |format|
|
38
|
+
format.json {
|
39
|
+
render json: {
|
40
|
+
status: "OK"
|
41
|
+
}
|
42
|
+
}
|
43
|
+
format.html
|
44
|
+
end
|
31
45
|
end
|
32
46
|
|
33
47
|
def bulk
|
@@ -46,7 +60,7 @@ class FileUpload::RedisFilesController < ApplicationController
|
|
46
60
|
respond_to do |format|
|
47
61
|
format.js {
|
48
62
|
render json: {
|
49
|
-
files: files.map
|
63
|
+
files: files.map(&:to_json)
|
50
64
|
}
|
51
65
|
}
|
52
66
|
end
|
data/lib/file_upload/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: file_upload
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Ching
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-filemagic
|
@@ -116,7 +116,7 @@ extensions: []
|
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
118
|
- app/assets/javascripts/file_upload/application.js
|
119
|
-
- app/assets/javascripts/file_upload.js
|
119
|
+
- app/assets/javascripts/file_upload.js
|
120
120
|
- app/assets/stylesheets/file_upload/application.css
|
121
121
|
- app/assets/stylesheets/file_upload.css
|
122
122
|
- app/controllers/file_upload/application_controller.rb
|