collection2csv 0.1.3 → 0.1.4
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: 43ae44a7c263e2b23ab48ec1fe14f2953be6b780
|
4
|
+
data.tar.gz: 7def884e570400c259567f02d658dbf737277157
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1882a29a6ff91646cda97de146fd0843f069f6ebf510dbe55813563c76e079cf93f938e38d755fceada81faaf1c7c765354ec7c3533aba33afa3d7d20af5c8b3
|
7
|
+
data.tar.gz: 69649b2bdd4534f9343791007be068b48b55b2908a2077cab4b5c70d529682125c7b7855ef9d328e1e7fe674513110af4351cfccb00f50828761c54b2bc4ed51
|
@@ -1,7 +1,8 @@
|
|
1
1
|
module CollectionToCsvHelper
|
2
|
-
|
2
|
+
def collection_download(collection,column_names={})
|
3
|
+
klass = collection.try(:first).class
|
4
|
+
raise "#{collection} is not a ActiveRecord collection" unless klass.ancestors.include?(ActiveRecord::Base)
|
3
5
|
collection_ids = collection.map(&:id)
|
4
|
-
|
5
|
-
|
6
|
-
end
|
6
|
+
link_to "Download" , collection2csv_path(ids: collection_ids,klass: klass,format: "csv",column_names: column_names)
|
7
|
+
end
|
7
8
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: collection2csv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ethiraj
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|