Re: A basic collections/hash question

comopasta Gr
Wed, 09 Sep 2009 20:56:52 -0000

Hi,

I managed to get over this problem.

The code I''m using now is:

data = params[:subcribers][:subscriber]
(data.is_a?(Array) ? data : [data]).each do |d|
   my_record = Report.create(d)
end

This works fine wether I have only one subscriber or many in the XML
Next will be doing a batch update. But that should be a different story
since my problem was doing the iteration with the data.

I found the hints from here:
http://railsforum.com/viewtopic.php?id=10888

Regards.