Search code examples
rubycsvfastercsv

Ruby csv read first line in csv file


Possible Duplicate:
Ruby view csv data

In my app i'm reading csv file, but why in view i have only second,...,n records, without first line? Here is code:

def common_uploader
    require 'csv' 
    @csv = CSV.read("/#{Rails.public_path}/uploads_prices/"+params[:file], {:encoding => "CP1251:UTF-8", :col_sep => ";", :row_sep => :auto, :headers => :false})
  end

:headers => :false i write... but why i didn't get first line from csv file? (ruby 1.9.3)

So, how to get also first line?


Solution

  • It should be false, not :false.