Bredon Jones


10 Experience
0 Lessons Completed
0 Questions Solved


Posted in Exporting Records To CSV Discussion

Very helpful, Chris!

One note on something I ran into... I found on a Rails 4.0 app with Ruby 2.0 that naming the method `to_csv` didn't work. The `to_csv` method from the Ruby CSV seemed to override my method and would just kick out a single row with each object in the set. Renaming the method to `export_csv` solved the problem for me.

Clearly something going on that is unusual in my app configuration, because as I understand it, this method should come "first".

Anyhow, working now!

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

© 2023 GoRails, LLC. All rights reserved.