<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" 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/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">

<channel>
	<title>ruby on rails blog</title>
	
	<link>http://jonathansng.com</link>
	<description>by: jonathan s ng, internet maven</description>
	<lastBuildDate>Wed, 08 Apr 2009 21:47:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/JonathanSNg" type="application/rss+xml" /><item>
		<title>Watermarking images paperclip’s post-processor</title>
		<link>http://jonathansng.com/ruby-on-rails/watermarking-images-paperclips-post-processor/</link>
		<comments>http://jonathansng.com/ruby-on-rails/watermarking-images-paperclips-post-processor/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 21:44:02 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[paperclip]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[watermark]]></category>

		<guid isPermaLink="false">http://jonathansng.com/?p=258</guid>
		<description><![CDATA[For those of you who wanted to use thoughtbot&#8217;s paperclip plugin to manage image uploads but were having trouble watermarking said images, behold!
http://github.com/ng/paperclip-watermarking-app/tree/master
]]></description>
		<wfw:commentRss>http://jonathansng.com/ruby-on-rails/watermarking-images-paperclips-post-processor/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dynamically set a domain for a Rails asset host</title>
		<link>http://jonathansng.com/ruby-on-rails/dynamically-set-a-domain-for-a-rails-asset-host/</link>
		<comments>http://jonathansng.com/ruby-on-rails/dynamically-set-a-domain-for-a-rails-asset-host/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 10:07:51 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[asset host]]></category>
		<category><![CDATA[asset hosts]]></category>
		<category><![CDATA[asset_host]]></category>

		<guid isPermaLink="false">http://jonathansng.com/?p=254</guid>
		<description><![CDATA[I&#8217;ve been wanting to implement an asset host for my Rails app, looking over the API I saw that Rails&#8217; asset_host only supported a single domain. I&#8217;m running multiple domains off one Rails app, so this would have been a problem. After a little research, I came up with a solution that would work for [...]]]></description>
		<wfw:commentRss>http://jonathansng.com/ruby-on-rails/dynamically-set-a-domain-for-a-rails-asset-host/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Simple non-model check box properties</title>
		<link>http://jonathansng.com/ruby-on-rails/simple-non-model-check-box-properties/</link>
		<comments>http://jonathansng.com/ruby-on-rails/simple-non-model-check-box-properties/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 11:11:01 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[check boxes]]></category>
		<category><![CDATA[check_box_tag]]></category>
		<category><![CDATA[non-model check box]]></category>
		<category><![CDATA[non-model properties]]></category>

		<guid isPermaLink="false">http://jonathansng.com/?p=252</guid>
		<description><![CDATA[Need to pass a property that isn&#8217;t associated with a model? I did. It took me a few minutes, but the solution is pretty easy. 
Instead of passing the instance variable your form is using, try this.


  


		
		
	


		
		
	


		
	



You&#8217;d access the property of the check box like so:

# log
Processing Admin::PostsController#create (for 127.0.0.1 at 2009-03-06 03:03:01) [...]]]></description>
		<wfw:commentRss>http://jonathansng.com/ruby-on-rails/simple-non-model-check-box-properties/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Paperclip deletes images with empty file fields update with rails 2.3</title>
		<link>http://jonathansng.com/ruby-on-rails/paperclip-deletes-images-with-empty-file-fields-update-with-rails-23/</link>
		<comments>http://jonathansng.com/ruby-on-rails/paperclip-deletes-images-with-empty-file-fields-update-with-rails-23/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 09:30:44 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[paperclip]]></category>
		<category><![CDATA[rails 2.3]]></category>

		<guid isPermaLink="false">http://jonathansng.com/?p=249</guid>
		<description><![CDATA[Bahhh! When you update a model that contains an empty file field in Rails 2.3 the attachment is deleted. It looks like empty file fields get passed as nil and then Paperclip gets angry.

Processing Admin::PostsController#update (for 127.0.0.1 at 2009-03-05 01:21:08) [PUT]
  Parameters: {"commit"=>"Update", "post"=>{"title"=>"Post Title", "image"=>nil}, "id"=>"124"}

There are two quick monkey patches that I&#8217;ve [...]]]></description>
		<wfw:commentRss>http://jonathansng.com/ruby-on-rails/paperclip-deletes-images-with-empty-file-fields-update-with-rails-23/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Watermark your images in Rails</title>
		<link>http://jonathansng.com/ruby-on-rails/watermark-your-images-in-rails/</link>
		<comments>http://jonathansng.com/ruby-on-rails/watermark-your-images-in-rails/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 22:39:03 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://jonathansng.com/?p=245</guid>
		<description><![CDATA[I&#8217;ve been working on a project that requires me to watermark all my images. Here&#8217;s a script I put together using rmagick. I plan on releasing a skeleton application that will accept uploaded files and watermark them.
Ideally, I&#8217;d like to use paperclip to handle uploading, and write a processor subclass to handle watermarking&#8230;unfortunately I&#8217;m running [...]]]></description>
		<wfw:commentRss>http://jonathansng.com/ruby-on-rails/watermark-your-images-in-rails/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Paperclip not saving your images?</title>
		<link>http://jonathansng.com/ruby-on-rails/paperclip-not-saving-your-images/</link>
		<comments>http://jonathansng.com/ruby-on-rails/paperclip-not-saving-your-images/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 07:23:21 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[paperclip]]></category>

		<guid isPermaLink="false">http://jonathansng.com/?p=242</guid>
		<description><![CDATA[I&#8217;ve had a few guys email me asking if I had any idea why Paperclip wasn&#8217;t saving their uploaded images. Here&#8217;s a form one of them sent me:


  

    
    

    
    

  

    



Notice anything different on [...]]]></description>
		<wfw:commentRss>http://jonathansng.com/ruby-on-rails/paperclip-not-saving-your-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check if a file exists in Rails</title>
		<link>http://jonathansng.com/ruby-on-rails/check-if-a-file-exists-in-rails/</link>
		<comments>http://jonathansng.com/ruby-on-rails/check-if-a-file-exists-in-rails/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 00:15:14 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://jonathansng.com/?p=236</guid>
		<description><![CDATA[Recently I was porting a legacy PHP application to Rails. One of the primary tasks was to resize a bunch of images. Below you can see what one of the database rows looks like.

mysql> SELECT id, filename FROM old_posts
+----+---------------------------------------+
&#124; id &#124; filename              [...]]]></description>
		<wfw:commentRss>http://jonathansng.com/ruby-on-rails/check-if-a-file-exists-in-rails/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Rails’ symbols: don’t create them dynamically!</title>
		<link>http://jonathansng.com/ruby-on-rails/rails-symbols-dont-create-them-dynamically/</link>
		<comments>http://jonathansng.com/ruby-on-rails/rails-symbols-dont-create-them-dynamically/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 21:34:43 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[dynamic symbols]]></category>
		<category><![CDATA[symbols]]></category>

		<guid isPermaLink="false">http://jonathansng.com/?p=230</guid>
		<description><![CDATA[Symbols are great, we use them in hashes all the time&#8230;but did you know, symbols aren&#8217;t part of Rails&#8217; garbage collection? When you create them, the memory the use has been allocated permanently! Why is this bad? So if we create a handful of symobls&#8230;no biggie, but what if we&#8217;re dynamically creating lots and lots [...]]]></description>
		<wfw:commentRss>http://jonathansng.com/ruby-on-rails/rails-symbols-dont-create-them-dynamically/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>rake db:migrate for production databases</title>
		<link>http://jonathansng.com/ruby-on-rails/rake-dbmigrate-for-production-databases/</link>
		<comments>http://jonathansng.com/ruby-on-rails/rake-dbmigrate-for-production-databases/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 11:27:56 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[db:migrate]]></category>
		<category><![CDATA[production]]></category>
		<category><![CDATA[rake]]></category>

		<guid isPermaLink="false">http://jonathansng.com/?p=226</guid>
		<description><![CDATA[After I updated one of my applications that I&#8217;ve been working on, I kept running into an internal server error. I looked at the logs and for some reason none of my SQL queries were working.
Looks like I ran &#8220;rake db:migrate&#8221; and migrated the development database&#8230;not the production one. I scratched my head trying to [...]]]></description>
		<wfw:commentRss>http://jonathansng.com/ruby-on-rails/rake-dbmigrate-for-production-databases/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>All Rails crash course tutorials are available on GitHub!</title>
		<link>http://jonathansng.com/ruby-on-rails/all-rails-crash-course-tutorials-are-available-on-github/</link>
		<comments>http://jonathansng.com/ruby-on-rails/all-rails-crash-course-tutorials-are-available-on-github/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 08:52:23 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[crashcourse]]></category>
		<category><![CDATA[downloads]]></category>
		<category><![CDATA[github]]></category>

		<guid isPermaLink="false">http://www.jonathansng.com/?p=223</guid>
		<description><![CDATA[ZIP files are silly   
I&#8217;ve created a GitHub repository for all the tutorials to date and plan on using GitHub to version control all future applications. I will be editing the posts and removing any old download links shortly.
The repository is located at:
http://github.com/ng/crashcourse/tree/master
Want to check out the code? Run this in terminal:

git clone [...]]]></description>
		<wfw:commentRss>http://jonathansng.com/ruby-on-rails/all-rails-crash-course-tutorials-are-available-on-github/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 0.599 seconds. --><!-- Cached page generated by WP-Super-Cache on 2009-06-23 08:39:17 --><!-- Compression = gzip -->
