btedev-comma 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/comma.rb +2 -1
- metadata +1 -1
data/lib/comma.rb
CHANGED
@@ -43,7 +43,8 @@ if defined?(ActionController)
|
|
43
43
|
module InstanceMethods
|
44
44
|
def render_with_csv(options = nil, extra_options = {}, &block)
|
45
45
|
return render_without_csv(options, extra_options, &block) unless (options.respond_to? '[]') and options[:csv]
|
46
|
-
|
46
|
+
filename = options[:filename] || "report.csv"
|
47
|
+
send_data Array(options[:csv]).to_comma(options[:style] ||= :default), :filename => filename
|
47
48
|
end
|
48
49
|
end
|
49
50
|
|