# CSV Upload Issue

**URL:** <https://www.ruby-forum.com/t/csv-upload-issue/190591>\
**Category:** Rails\
**Created:** [June 23, 2010, 2:56pm UTC](https://www.ruby-forum.com/t/csv-upload-issue/190591 "2010-06-23T14:56:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [June 23, 2010, 2:56pm UTC](https://www.ruby-forum.com/t/csv-upload-issue/190591/1 "2010-06-23T14:56:53Z")

</div>

CSV:

[http://pastie.org/1015772](http://pastie.org/1015772)

Controller:

[http://pastie.org/1015773](http://pastie.org/1015773)

Why is it that it’s only saving the record for “EFG5”? I’m obviously  
missing something.

---

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [June 23, 2010, 4:46pm UTC](https://www.ruby-forum.com/t/csv-upload-issue/190591/2 "2010-06-23T16:46:07Z")

</div>

On Jun 23, 2010, at 8:56 AM, Pale H. wrote:

> CSV:
> 
> [http://pastie.org/1015772](http://pastie.org/1015772)
> 
> Controller:
> 
> [http://pastie.org/1015773](http://pastie.org/1015773)
> 
> Why is it that it’s only saving the record for “EFG5”? I’m obviously  
> missing something.

The call to .save the model is outside of the loop.

You should indicate which version of ruby you’re using as the  
implementation of CSV changed between 1.8 and 1.9 (the former  
FasterCSV replaced the old CSV in the standard library for 1.9 and  
assumed the shorter name).

-Rob

Rob B.  
[http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid

> **[Launch Scout Custom Software Development & Software Consulting](https://launchscout.com/)**
>
> We solve digital problems through custom software development and design for the web—apps, mobile, desktop and devices.

removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [June 24, 2010, 10:13am UTC](https://www.ruby-forum.com/t/csv-upload-issue/190591/3 "2010-06-24T10:13:45Z")

</div>

Rob B. wrote:

> The call to .save the model is outside of the loop.
> 
> You should indicate which version of ruby you’re using as the  
> implementation of CSV changed between 1.8 and 1.9 (the former  
> FasterCSV replaced the old CSV in the standard library for 1.9 and  
> assumed the shorter name).
> 
> -Rob
> 
> Rob B.  
> [http://agileconsultingllc.com](http://agileconsultingllc.com)  
> removed\_email\_address@domain.invalid  
> [http://gaslightsoftware.com](http://gaslightsoftware.com)  
> removed\_email\_address@domain.invalid

Thank you. I am using 1.8.
