danielfone / as_csv

Instant CSV support for Rails
MIT License
19 stars 9 forks source link

`to_csv` output without headers #6

Closed denied404 closed 1 year ago

denied404 commented 8 years ago

Hi! First of all, thanks for this gem :) I have an issue related to to_csv method output. I can't find a way to exclude headers from the output. I've tried to pass { write_headers: false } to csv_output, but without success. Is there any possibility at the moment to avoid headers in serialized output?

Thanks!

denied404 commented 8 years ago

I've investigate the sources and think that the problem is here:

def rows
  @rows ||= [headers] + data_rows
end

There is no way to exclude [headers] from rows now. It would be great to have an option like exclude_headers or so. Actually, I can make a PR but first I want to be sure if there is no other way to do it. :)

danielfone commented 8 years ago

@denied404 I'd welcome a PR. It's been a while since I worked on it but I don't recall a way to exclude headers.

danielfone commented 1 year ago

Closing this issue as stale. Feel free to reopen if still desired.