lib/cloudxls-rails/handlers/xlsx.rb in cloudxls-rails-0.4.2 vs lib/cloudxls-rails/handlers/xlsx.rb in cloudxls-rails-0.4.3

- old
+ new

@@ -28,12 +28,13 @@ # For respond_to default class ActionController::Responder def to_xlsx - if options[:stream] == true + stream = options.delete(:stream) || false + if stream # either string or boolean options[:data] ||= {} - options[:data][:url] ||= controller.request.url.gsub(/xlsx\Z/, "csv") + options[:data][:url] ||= cloudxls_stream_url(stream, 'xlsx') end CloudXLSRails::XLSXResponder.redirect!(controller, resources.last, options) end end