<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Ruby on Rails: Import CSV data into database</title>
	<atom:link href="http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/feed/" rel="self" type="application/rss+xml" />
	<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
	<description>These are my experiences making Technology work</description>
	<lastBuildDate>Tue, 23 Mar 2010 23:41:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Darren</title>
		<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/comment-page-1/#comment-431</link>
		<dc:creator>Darren</dc:creator>
		<pubDate>Tue, 23 Mar 2010 23:41:17 +0000</pubDate>
		<guid isPermaLink="false">http://goodbadtech.com/?p=43#comment-431</guid>
		<description>Forgot to mention in my last comment but if you push this to a background job you should do some (rescue FasterCSV::MalformedCSVError) action. Or even better do it if not tossing to background job so you don&#039;t get app errors if users upload a file that isn&#039;t parsed perfectly.</description>
		<content:encoded><![CDATA[<p>Forgot to mention in my last comment but if you push this to a background job you should do some (rescue FasterCSV::MalformedCSVError) action. Or even better do it if not tossing to background job so you don&#8217;t get app errors if users upload a file that isn&#8217;t parsed perfectly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: /good/bad/tech</title>
		<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/comment-page-1/#comment-430</link>
		<dc:creator>/good/bad/tech</dc:creator>
		<pubDate>Tue, 23 Mar 2010 21:42:04 +0000</pubDate>
		<guid isPermaLink="false">http://goodbadtech.com/?p=43#comment-430</guid>
		<description>Thanks for the feedback.  I&#039;m glad it helped you out.</description>
		<content:encoded><![CDATA[<p>Thanks for the feedback.  I&#8217;m glad it helped you out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg</title>
		<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/comment-page-1/#comment-429</link>
		<dc:creator>Greg</dc:creator>
		<pubDate>Fri, 19 Mar 2010 12:50:49 +0000</pubDate>
		<guid isPermaLink="false">http://goodbadtech.com/?p=43#comment-429</guid>
		<description>Just implemented for a project.  Works great.  Many thanks for the work.
 </description>
		<content:encoded><![CDATA[<p>Just implemented for a project.  Works great.  Many thanks for the work.<br />
 </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darren</title>
		<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/comment-page-1/#comment-428</link>
		<dc:creator>Darren</dc:creator>
		<pubDate>Wed, 24 Feb 2010 20:20:16 +0000</pubDate>
		<guid isPermaLink="false">http://goodbadtech.com/?p=43#comment-428</guid>
		<description>Err I meant model</description>
		<content:encoded><![CDATA[<p>Err I meant model</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darren</title>
		<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/comment-page-1/#comment-427</link>
		<dc:creator>Darren</dc:creator>
		<pubDate>Wed, 24 Feb 2010 09:34:35 +0000</pubDate>
		<guid isPermaLink="false">http://goodbadtech.com/?p=43#comment-427</guid>
		<description>In regards to moving the logic into the controller: http://gist.github.com/313281
This is just a quick example and I&#039;m not sure it would work perfect. My setup is quite a lot different, but a good  starting point.
Also error handling could be done a few ways. For me first I&#039;m using delayed_job and after a csv file is uploaded I past off the load to delayed_job b/c we have imports of 100,000 + lines. As load_csv method is looping over rows we collect errors, if any, into an array and send out the results in an email.</description>
		<content:encoded><![CDATA[<p>In regards to moving the logic into the controller: http://gist.github.com/313281<br />
This is just a quick example and I&#8217;m not sure it would work perfect. My setup is quite a lot different, but a good  starting point.<br />
Also error handling could be done a few ways. For me first I&#8217;m using delayed_job and after a csv file is uploaded I past off the load to delayed_job b/c we have imports of 100,000 + lines. As load_csv method is looping over rows we collect errors, if any, into an array and send out the results in an email.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: /good/bad/tech</title>
		<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/comment-page-1/#comment-425</link>
		<dc:creator>/good/bad/tech</dc:creator>
		<pubDate>Tue, 23 Feb 2010 19:31:59 +0000</pubDate>
		<guid isPermaLink="false">http://goodbadtech.com/?p=43#comment-425</guid>
		<description>Hi John,

I&#039;m glad the post was helpful and that you already tracked down answer for the question you had.

Regards,
Spencer</description>
		<content:encoded><![CDATA[<p>Hi John,</p>
<p>I&#8217;m glad the post was helpful and that you already tracked down answer for the question you had.</p>
<p>Regards,<br />
Spencer</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John McLeod</title>
		<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/comment-page-1/#comment-423</link>
		<dc:creator>John McLeod</dc:creator>
		<pubDate>Wed, 17 Feb 2010 18:56:47 +0000</pubDate>
		<guid isPermaLink="false">http://goodbadtech.com/?p=43#comment-423</guid>
		<description>Found it.
My routes were messed up.
map.import_proc &#039;/import/proc/id&#039;, :controller =&gt; &#039;imports&#039;, :action =&gt; &#039;proc_csv&#039;
should be...
map.import_proc &#039;/import/proc/:id&#039;, :controller =&gt; &#039;imports&#039;, :action =&gt; &#039;proc_csv&#039;
John</description>
		<content:encoded><![CDATA[<p>Found it.<br />
My routes were messed up.<br />
map.import_proc &#8216;/import/proc/id&#8217;, :controller =&gt; &#8216;imports&#8217;, :action =&gt; &#8216;proc_csv&#8217;<br />
should be&#8230;<br />
map.import_proc &#8216;/import/proc/:id&#8217;, :controller =&gt; &#8216;imports&#8217;, :action =&gt; &#8216;proc_csv&#8217;<br />
John</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John McLeod</title>
		<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/comment-page-1/#comment-422</link>
		<dc:creator>John McLeod</dc:creator>
		<pubDate>Wed, 17 Feb 2010 18:41:56 +0000</pubDate>
		<guid isPermaLink="false">http://goodbadtech.com/?p=43#comment-422</guid>
		<description>I can replace Line 11 with...
&lt;%= link_to &quot;process&quot;, :controller =&gt; &#039;imports&#039;, :action =&gt; &#039;proc_csv&#039;, :id =&gt; @import.id %&gt;
and everything works fine.
John</description>
		<content:encoded><![CDATA[<p>I can replace Line 11 with&#8230;<br />
&lt;%= link_to &#8220;process&#8221;, :controller =&gt; &#8216;imports&#8217;, :action =&gt; &#8216;proc_csv&#8217;, :id =&gt; @import.id %&gt;<br />
and everything works fine.<br />
John</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John McLeod</title>
		<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/comment-page-1/#comment-421</link>
		<dc:creator>John McLeod</dc:creator>
		<pubDate>Wed, 17 Feb 2010 16:25:27 +0000</pubDate>
		<guid isPermaLink="false">http://goodbadtech.com/?p=43#comment-421</guid>
		<description>Hello,
Thanks for the tutorial, it helped extremely.
I do have a little problem.
The import is created but the proc_csv does not.
I get an ...
&quot;&lt;code&gt;undefined method `to_sym&#039; for nil:NilClass&quot; error on the Imports/show view - Line 11.&lt;/code&gt;
&lt;code&gt;8: 
9: &lt;% else %&gt;
10: 
11: &lt;%= link_to &quot;process&quot;, import_proc_path(@import.id) %&gt;
12: 
13: &lt;% end %&gt;

Thank you for any help with this.

John
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Hello,<br />
Thanks for the tutorial, it helped extremely.<br />
I do have a little problem.<br />
The import is created but the proc_csv does not.<br />
I get an &#8230;<br />
&#8220;<code>undefined method `to_sym' for nil:NilClass" error on the Imports/show view - Line 11.</code><br />
<code>8:<br />
9: &lt;% else %&gt;<br />
10:<br />
11: &lt;%= link_to "process", import_proc_path(@import.id) %&gt;<br />
12:<br />
13: &lt;% end %&gt;</p>
<p>Thank you for any help with this.</p>
<p>John<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sai</title>
		<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/comment-page-1/#comment-420</link>
		<dc:creator>Sai</dc:creator>
		<pubDate>Fri, 05 Feb 2010 00:55:56 +0000</pubDate>
		<guid isPermaLink="false">http://goodbadtech.com/?p=43#comment-420</guid>
		<description>Ah, thank you for clarifying this. What are the benefits of &lt;% .save! %&gt; over &lt;% .save %&gt;? I thought the validations would have been run regardless.
Also, save! appears to raise ActiveRecord::RecordInvalid, as opposed to the neater error_messages which are available via the view. Is it possible to raise a neater error message? As far as I can tell, it isn&#039;t, but I may be wrong.</description>
		<content:encoded><![CDATA[<p>Ah, thank you for clarifying this. What are the benefits of &lt;% .save! %&gt; over &lt;% .save %&gt;? I thought the validations would have been run regardless.<br />
Also, save! appears to raise ActiveRecord::RecordInvalid, as opposed to the neater error_messages which are available via the view. Is it possible to raise a neater error message? As far as I can tell, it isn&#8217;t, but I may be wrong.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
