btedev-comma 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
|