lib/comma.rb in btedev-comma-0.1.7 vs lib/comma.rb in btedev-comma-0.1.8

- old
+ new

@@ -41,10 +41,11 @@ end module InstanceMethods def render_with_csv(options = nil, extra_options = {}, &block) return render_without_csv(options, extra_options, &block) unless (options.respond_to? '[]') and options[:csv] - send_data Array(options[:csv]).to_comma(options[:style] ||= :default), :filename => "test.csv" + filename = options[:filename] || "report.csv" + send_data Array(options[:csv]).to_comma(options[:style] ||= :default), :filename => filename end end end \ No newline at end of file