when i click on download a file with data is getting stored in the tmp/
folder where as in client side it is downloading 1 byte file.(empty
file)
def exporting_data
@list = User.find(:all)
FasterCSV.open("/home/ajit/Projects/xsampleapps/tmp/exports/your_data.csv",
"w+") do |csv|
csv << ["Name","Age" ]
@list.each do |record|
csv << [record.name, record.age]
end
end
send_file
'/home/ajit/Projects/xsampleapps/tmp/exports/your_data.csv',
:type => 'application/csv',
:x_sendfile => true
end
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.