hi,

I'm not sure if this possible, a user will upload a csv file, fixed
header/format, say a monthly billing like;

Jan, Feb, Mar......, Dec <- fixed header
11, 22, 33, 44........99 <- some random numbers, but could be multiple
rows

for some reasons, I don't want to store the csv data in db/model.
I got the paperclip working & uses FasterCSV to extracted the csv
data, but when I asked
hobo_show to render format.xml it thrown out error:

Not all elements respond to to_xml

anyone shed some lights??

here's my controller:
  def show
    hobo_show do |format|
      format.xml do
        @csv_data = FasterCSV.read(@energy.csv.path)
        render :xml => @csv_data
      end
      format.html do
      # default hobo show
      end
    end
  end

model Energy just has a name & has_attached_file :csv
when replace @csv_data with @energy I got the xml rendered about the
uploaded file,
but that's not what I want, I want to display the content of the csv
file shown as xml.

--
  munkean

-- 
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.

Reply via email to