module RenderAsCSV
  def self.included(base)
    base.alias_method_chain :render, :csv
  end

  def render_with_csv(options = nil, extra_options = {}, &block)
    return render_without_csv(options, extra_options, &block) unless options.is_a?(Hash) and [:csv].present?
    data = options.delete(:csv)
    style = options.delete(:style) || :default
    send_data Array(data).to_comma(style), options.merge(:type => :csv)
  end
end

module RenderAsCSV
  def self.included(base)
    base.alias_method_chain :render, :csv
  end

  def render_with_csv(options = nil, extra_options = {}, &block)
    return render_without_csv(options, extra_options, &block) unless options.is_a?(Hash) and options[:csv].present?
    data = options.delete(:csv)
    style = options.delete(:style) || :default
    send_data Array(data).to_comma(style), options.merge(:type => :csv)
  end
end

Fix for csv options being present
Fix for csv options being present
