Hi guys
I'm trying to upload data into the database and I've done so using
paperclip. However, l am having trouble loading the contents into the
database. This is my model:
import.rb:
class Import < ActiveRecord::Base
hobo_model # Don't put anything above this
fields do
datatype :string
abu :string
paul :string
age :integer
timestamps
end
# Paperclip
has_attached_file :csv
validates_attachment_presence :csv
validates_attachment_content_type :csv, :content_type =>
['text/csv','text/comma-separated-values','text/csv','application/csv','application/excel','application/vnd.ms-excel','application/vnd.msexcel','text/anytext','text/plain']
With adding <include src="paperclip" plugin="paperclip_with_hobo"/> in
applications.dryml, this works fine and it loads the csv file in
public/systems/csvs
I am having trouble using Fastercsv to load the contents into the database.
Anyone has done this before. Any pointers will be appreciated.
Ali
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.