send_csv 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/send_csv.rb +8 -3
- metadata +3 -3
data/lib/send_csv.rb
CHANGED
@@ -1,9 +1,15 @@
|
|
1
1
|
module SendCsv
|
2
|
-
VERSION = '0.
|
2
|
+
VERSION = '0.2'
|
3
3
|
end
|
4
4
|
|
5
|
-
|
5
|
+
require 'action_controller' # Make sure ActionController::Base is defined
|
6
|
+
|
7
|
+
ActionController::Base.class_eval do
|
8
|
+
private
|
9
|
+
|
6
10
|
def send_csv(lines, options = {})
|
11
|
+
require 'csv'
|
12
|
+
|
7
13
|
options = options.dup
|
8
14
|
encoding = options.delete(:encoding) || 'ISO-8859-1'
|
9
15
|
|
@@ -18,4 +24,3 @@ class ApplicationController
|
|
18
24
|
send_data csv, options
|
19
25
|
end
|
20
26
|
end
|
21
|
-
|
metadata
CHANGED