Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

how to write CSV file in rails

require 'csv'
file = "my_file.csv"
CSV.open( file, 'w' ) do |writer|
  @coun.each do |c|
    writer << [c.name, c.country_code, c.user_id, c.subscriber_id]
  end
end
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #write #CSV #file #rails
ADD COMMENT
Topic
Name
8+3 =