hi all,
I want to convert my data as CSV file. just i used simple coding, i
didn’t use fastercsv, because i installed in my system, but i couldn’t
see where it install, if i run also , it said there is no fastercsv
file. actaully i don’t know how to use that.
so now i used simple code is, but in this csv file is downloaded , by
its coming with all HTML tags, even i didn’t use any html tags. so i
want to know how to avoid this. please any one help me. thanks in
advance.
in controller:
def report
@partner=Code.find(:all)
response.headers[‘Content-Type’] = ‘text/csv; charset=iso-8859-1;
header=present’
response.headers[‘Content-Disposition’] = ‘attachment;
filename=report.csv’
end
in rhtml:
Title,Value
<% @partners.each do |model| -%>
“<%= model.member_fname %>”,<%= model.member_lname %>
<% end -%>