I\'m working to export csv data from rails. I\'m following the tutorial here: http://railscasts.com/episodes/362-exporting-csv-and-excel?view=asciicast
In my control
A quick version for rails console that is not for prod but just to have access to the data in excel:
first do :
print TableName.first.attributes.map{|a,v| a}.join(",")
second do :
TableName.all.each{|t| print t.attributes.map{|a,v| a}.join(",") + "\n"}; nil
copy the result of this two call in a csv file