RailsCasts Pro episodes are now free!

Learn more or hide this

Andy Weber's Profile

GitHub User: ahabman

Site: http://ahabman.com

Comments by Andy Weber


For me Products::to_csv did not successfully get called. Instead, a comma separated list of objecs was rendered. e.g #<MyObject:0x007fb05ee9eb00>,#<MyObject:0x007fb05ee9e4e8> (which is the same output as when there is no def self.to_csv)

I was only able to use this design by changing
format.csv { send_data @products.to_csv }
format.csv { send_data Product.to_csv(@products) }

Rails 3.2.8