Displaying 3 results from an estimated 3 matches for "csv_string".
Did you mean:
cli_string
2009 Jan 14
1
setting header in views?
currently iam using FasterCSV to render csv pages
format.csv do
csv_string = FasterCSV.generate do |csv|
# header row
csv << @query_result[0].keys
@query_result.each do |x|
csv << x.values
end
end
#send it to the browser
send_data csv_string,
:type => ''text/csv;...
2007 Feb 26
2
Problem concerning CSV Mime Type
...lication that should be able to export a list of users as
CSV.
So I put
Mime::Type.register "text/csv", :csv
into my environment.rb, and added this code to my UserController''s index
action:
format.csv do
require ''csv''
CSV::Writer.generate(csv_string = "", '','') do |csv|
csv << ["login","attribute1","attribute2"]
@users.each { |user| csv << [user.login, user.email] }
end
send_data csv_string, :filename => "users.csv"
end...
2008 Feb 11
0
send_data problem
Hi!
Following call for sending data does not sets the HTTP Content-Type
header under Rails 2.02:
send_data(csv_string,:filename => @entity.name+".csv", :type => ''text/
csv; charset=UTF-8'')
Can anyone help why its happening?
Regards,
Mohsin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby o...