<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>puneetpandey.com</title>
	<atom:link href="http://puneetpandey.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://puneetpandey.com</link>
	<description>Ruby on Rails Delivery Expert Blog (ALPHA)</description>
	<lastBuildDate>Thu, 05 Apr 2012 07:32:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>A new way of Installing pik on Windows</title>
		<link>http://puneetpandey.com/2012/03/a-new-way-of-installing-pik-on-windows/</link>
		<comments>http://puneetpandey.com/2012/03/a-new-way-of-installing-pik-on-windows/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 18:09:16 +0000</pubDate>
		<dc:creator>Puneet Pandey</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[how to install pik in 8 steps]]></category>
		<category><![CDATA[pik]]></category>
		<category><![CDATA[pik for ruby]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby187]]></category>
		<category><![CDATA[Ruby193]]></category>
		<category><![CDATA[Simpler way to install pik on windows]]></category>

		<guid isPermaLink="false">http://puneetpandey.com/?p=170</guid>
		<description><![CDATA[Hi Guys, In my previous article, don&#8217;t hesitate to try out new things in Ruby on Rails, you got to know, how to install and configure pik to support multiple versions of Ruby on Windows. In this article, I will add another simpler way to install pik on windows and configuring it for multiple versions [...]]]></description>
			<content:encoded><![CDATA[<p>Hi Guys,</p>
<p>In my previous article, <a href="http://puneetpandey.com/2011/02/dont-hesitate-to-try-out-new-things-in-ruby/" title="Pik">don&#8217;t hesitate to try out new things in Ruby on Rails</a>, you got to know, how to install and configure <strong>pik</strong> to support multiple versions of <strong>Ruby on Windows</strong>.</p>
<p>In this article, I will add another simpler way to <strong>install pik on windows</strong> and configuring it for multiple versions of ruby. For <strong>Devkit</strong>, you can follow the same old article.</p>
<p><strong>NOTE</strong>: I will go with <strong>Ruby192</strong> and on that <strong>Ruby187</strong> and so on&#8230; You can accomplish it in a reverse mode as well.</p>
<p>Step1: Download <strong>Ruby193</strong> from <a href="http://rubyinstaller.org/downloads/" title="Ruby193" target="_blank">here</a>. Do install the RubyInstaller version i.e .exe file.</p>
<p>Step2: After downloading, Install it (click on that checkbox which will say, add Ruby to your environmental variables path).</p>
<p>Step3: Once the installation is done, open a command window and type:<br />
<code>ruby -v</code><br />
It will tell you that, current Ruby is 1.9.3</p>
<p>Step4: Install the pik gem. Type:<br />
<code>gem install pik</code></p>
<p>Step5: Type- <code>pik_install C:/tools</code></p>
<p>Step6: Add this path to your Environmental variables<br />
<code>My Computer > Right Click > Properties > Advanced System Settings > Environmental Variables > Path</code></p>
<p>Step7: Now, go to <a href="http://rubyinstaller.org/downloads/" title="RubyInstaller" target="_blank">RubyInstaller.org</a> and download the 7-zip archive of Ruby187 i.e Ruby 1.8.7-p358.</p>
<p>Step8: Once the download is finished, extract all the content of that file inside C:\ folder, using 7-zip utility. After extracting, rename the folder to Ruby187.</p>
<p>Step9: Open a new command window and type:<br />
<code>pik add C:\Ruby187\bin</code></p>
<p>Yuppy!! it will add 187 into the existing versions of Ruby. From here you can install &#8216;N&#8217; number of Ruby versions on Windows.</p>
<p>Advantages of doing this:</p>
<ul>
<li>If using Netbeans, you can now easily configure/add/manage multiple versions of Ruby.</li>
<li>If you follow the old approach, your pik version of Ruby won&#8217;t able to include the DevKit, due to which you may face problems, while installing Native extension gems. For e.g consider this path: C:/Users/foo bar/.pik/rubies/. It contains a space between foo and bar. So devkit skips this many of the times.</li>
</ul>
<p>Happy coding&#8230; <img src='http://puneetpandey.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Your feebback/suggestions are always welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://puneetpandey.com/2012/03/a-new-way-of-installing-pik-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Journey from Ruby on Rails to iPad Development</title>
		<link>http://puneetpandey.com/2011/08/a-journey-from-ruby-on-rails-to-ipad-development/</link>
		<comments>http://puneetpandey.com/2011/08/a-journey-from-ruby-on-rails-to-ipad-development/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 19:03:01 +0000</pubDate>
		<dc:creator>Puneet Pandey</dc:creator>
				<category><![CDATA[iPad]]></category>
		<category><![CDATA[Objective C]]></category>
		<category><![CDATA[Sqlite3]]></category>

		<guid isPermaLink="false">http://puneetpandey.com/?p=166</guid>
		<description><![CDATA[Hello Everyone, Since last couple of months, I was very busy in travelling, looking after my family, managing lot of other things. That&#8217;s why I didn&#8217;t get a chance to update my Blog. One interesting thing, which happened 1 month back, is somehow, I got an opportunity to work with iPad Application. At first I [...]]]></description>
			<content:encoded><![CDATA[<p>Hello Everyone,</p>
<p>Since last couple of months, I was very busy in travelling, looking after my family, managing lot of other things. That&#8217;s why I didn&#8217;t get a chance to update my Blog.</p>
<p>One interesting thing, which happened 1 month back, is somehow, I got an opportunity to work with iPad Application. At first I thought, I am into RoR development since last 3 years, so why should I learn this new technology? What&#8217;s the future of it? Where I will be after 2 years down the line?</p>
<p>And surprisingly, I got an offer to work with both the technologies (i.e Ruby on Rails as well as iPad). Looks overload, isn&#8217;t it? Not at all <img src='http://puneetpandey.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I admit the fact, that I am bit out of touch with the recent updates happening in Ruby on Rails community, because of the new iPad project, but I am hoping to get myself back into this very soon. But my existing knowledge into RoR, is helping my and my team, to accelerate the development speed.</p>
<p>In this post, I would like to tell you about the background of iPad development, Obejctive-C and Sqlite3 database.</p>
<p>This is not an in-depth technical article, but It will certainly help those developers, who are shifting their technologies or would like to try iPad/iPhone development.</p>
<p>To start with Basic development, all you need is:</p>
<ul>
<li> <strong>The basic/advanced knowledge of Objective-C</strong>, which you&#8217;ll find it easy to learn at first go, but way to difficult when it comes to actual implementation. So be very focused while learning.</li>
<li><strong>An Apple Machine</strong>. Mac/Mac Mini would be good to go.</li>
<li><strong>Xcode</strong> &#8211; A development tool for building iPad/iPhone App.</li>
<li><strong>Sqlite3</strong> &#8211; All applications running on iPad/iPhone are using Sqlite3 as a Data Storage device. So, If you&#8217;re thinking of using MySQL or Oracle or any database of your choice, the answer is &#8216;NO&#8217;</li>
<li><strong>iPad Device</strong>: To test your application and see how it actually runs on iPad</li>
<li>On top of all this, you must have an Apple account. Charges to create your account is 1$.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://puneetpandey.com/2011/08/a-journey-from-ruby-on-rails-to-ipad-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jquery on Rails3 auto select</title>
		<link>http://puneetpandey.com/2011/05/jquery-on-rails3-auto-select/</link>
		<comments>http://puneetpandey.com/2011/05/jquery-on-rails3-auto-select/#comments</comments>
		<pubDate>Sun, 22 May 2011 19:00:33 +0000</pubDate>
		<dc:creator>Puneet Pandey</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Ajax Search with Rails 3]]></category>
		<category><![CDATA[rails 3]]></category>
		<category><![CDATA[Rails 3 Jquery]]></category>
		<category><![CDATA[Rails 3 UJS]]></category>
		<category><![CDATA[Ruby on Rails auto select]]></category>

		<guid isPermaLink="false">http://puneetpandey.com/?p=156</guid>
		<description><![CDATA[Hello Folks, In earlier post of mine, we have seen, how to implement &#8220;Auto Select&#8221;, with the help of Prototype and Rails. Now, that Rails-3 has been released, lot of changes are already made. In-built support for Prototype has been removed. Still if you wish to use prototype, all you need is to install its [...]]]></description>
			<content:encoded><![CDATA[<p>Hello Folks,</p>
<p>In <a href="http://puneetitengineer.wordpress.com/2008/06/01/ruby-on-rails-auto-select/" target="_blank"><strong>earlier post of mine</a>, we have seen, how to implement <strong>&#8220;Auto Select&#8221;</strong>, with the help of <strong>Prototype and Rails</strong>.</p>
<p>Now, that <strong>Rails-3</strong> has been released, lot of changes are already made. In-built support for <strong>Prototype</strong> has been removed. Still if you wish to use prototype, all you need is to install its gem.</p>
<p>Here, I am covering the same example:<br />
<strong><br />
- Select &#8216;Country&#8217; from the first drop down.<br />
- Second drop down will populate the list of &#8216;States&#8217;. If you select any state:<br />
- Third drop down will populate the list of &#8216;Countries&#8217;.<br />
</strong></p>
<p>All I am using here is <strong>Rails-3, Rails-3 UJS, and Jquery</strong>.</p>
<p>I would also like to thank <strong>Ryan Bates</strong>, for the railscasts he provided to implement this using <strong>unobtrusive javascript</strong>.</p>
<p>Please download the application with the link provided and let me know your feedback.</p>
<p>System Requirements/Features Covered in this application.<br />
- Ruby 1.8.7<br />
- Rails 3.0.0 or higher<br />
- Country -> State -> City Drop down<br />
- Ajax Search</p>
<p>Steps to run the application:<br />
- Create a schema. Change the database.yml accordingly.<br />
- Run rake db:migrate<br />
- Start the server.<br />
- Please do read the <strong>README</strong> file.</p>
<p><a href='http://puneetpandey.com/wp-content/uploads/2011/05/jquery-autoselect.zip'>jquery-autoselect</a></p>
<p>Regards</p>
<div id="fb-root"></div>
<p><script src="http://connect.facebook.net/en_US/all.js#appId=207351342636825&amp;xfbml=1"></script><fb:like href="http://puneetpandey.com/2011/05/jquery-on-rails3-auto-select/" send="true" width="450" show_faces="true" font="verdana"></fb:like></p>
]]></content:encoded>
			<wfw:commentRss>http://puneetpandey.com/2011/05/jquery-on-rails3-auto-select/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t hesitate to try out new things in Ruby</title>
		<link>http://puneetpandey.com/2011/02/dont-hesitate-to-try-out-new-things-in-ruby/</link>
		<comments>http://puneetpandey.com/2011/02/dont-hesitate-to-try-out-new-things-in-ruby/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 20:14:45 +0000</pubDate>
		<dc:creator>Puneet Pandey</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Development kit for Ruby]]></category>
		<category><![CDATA[how to install and configure pik on windows]]></category>
		<category><![CDATA[How to install Devkit on windows]]></category>
		<category><![CDATA[pik]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rails 3]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[ruby 1.8.7]]></category>
		<category><![CDATA[ruby 1.9.2]]></category>
		<category><![CDATA[ruby Devkit]]></category>

		<guid isPermaLink="false">http://puneetpandey.com/?p=137</guid>
		<description><![CDATA[Since last couple of months, I was trying installing Rails-3 on my Windows PC. When I heard, that Rails-3 requires ruby-1.8.7 or higher, I instantly removed Ruby-1.8.6 and all its components and installed 1.8.7 from the fresh point. I was happy, as my new system has Rails-3 now&#8230; Wow, what else I need? But later, [...]]]></description>
			<content:encoded><![CDATA[<p>Since last couple of months, I was trying installing <strong>Rails-3</strong> on my <strong>Windows PC</strong>.<br />
When I heard, that <strong>Rails-3 requires ruby-1.8.7 or higher</strong>, I instantly removed Ruby-1.8.6 and all its components and installed 1.8.7 from the fresh point.</p>
<p>I was happy, as my new system has Rails-3 now&#8230; Wow, what else I need?</p>
<p>But later, I found that my few of my old applications, which requires ruby-1.8.6 have stopped working. WTH!! Can&#8217;t it work with Ruby-1.8.7 now? With the investigation, I observed that, there were few libraries which were specific to 1.8.6 version and are not in 1.8.7 now. Some of them, I restored from 186 to 187 but were not compatible. Urrrgghhh!!! I am disappointed <img src='http://puneetpandey.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p>Now, I need some sort of <strong>version Manager</strong>, which will handle multiple version of Ruby. From here my search starts!!</p>
<p>After searching a lot on Google, and suggested by one of my friend, I found &#8216;<strong>pik</strong>&#8216;.<br />
<strong>Short Intro about Pik</strong>: <strong>Pik is a version manager for Ruby</strong>. You can handle/install multiple versions of Ruby and switch between them easily.</p>
<p><strong>Basic Requirement</strong>: You must have atleast one version of Ruby, up and running on Windows.</p>
<p><strong>Installation</strong>: &#8216;pik&#8217; comes as a gem. To install pik, follow these steps:<strong></p>
<p>Dependencies</strong>:<br />
> my current plateform: ruby-1.8.6. From the command prompt, type:<br />
<code>gem install pik</code><br />
> After the successful installation of pik, type:<br />
<code>pik_install C:\tools</code><br />
> Add this to your Path Environmental variables<br />
<code> My Computer > Right Click > Properties > Advanced System Settings > Environmental Variables > Path </code></p>
<p>Once you&#8217;re done. Open a new command prompt and type:<br />
<code>pik list</code><br />
It will add the current version of ruby into the list.<br />
Now what&#8217;s so special about pik? How it can handle the multiple versions? To see that in action, in command prompt, type:<br />
<code>pik install ruby 1.8.7</code><br />
and this will start downloading and once downloaded it will install 1.8.7, under:<br />
<code>C:\Users\PC-name\.pik\rubies\Ruby-187-p302</code></p>
<p>Awesome!! isn&#8217;t it?<br />
<code>pik list</code><br />
It will show you the current version of ruby and the other ones.<br />
<code>pik use 187</code><br />
Will use now ruby-187. Don&#8217;t believe me? <img src='http://puneetpandey.com/wp-includes/images/smilies/icon_mad.gif' alt=':-x' class='wp-smiley' />  Then type:<br />
<code>ruby -v</code></p>
<p>I am super excited now <img src='http://puneetpandey.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' />  I want to install Ruby-1.9.2 now. Afraid? Still hesitate? Don&#8217;t be, just follow the instructions&#8230;<br />
From the command window, type:<br />
<code>pik install ruby 1.9.2</code><br />
Heights of happiness&#8230; It is installing 1.9.2 now!!<br />
Path will remain the same, i.e:<br />
<code>C:\Users\PC-Name\.pik\rubies\Ruby-192p302</code></p>
<p>Do a <code>pik list</code> now and you&#8217;ll see:<br />
<a href="http://puneetpandey.com/wp-content/uploads/2011/02/pik.bmp"><img src="http://puneetpandey.com/wp-content/uploads/2011/02/pik.bmp" alt="" title="pik" class="aligncenter size-full wp-image-139" /></a></p>
<p>Now, I am running multiple versions of Ruby on my Windows m/c and I can select any version by:<br />
<code>pik use 187<br />
gem install rails --include-dependencies<br />
rails s -p 4000</code></p>
<p>and can perform numerous operations&#8230; Yuppy!!!!</p>
<p>Here comes the another pain. Few days back I thought to work with <strong>Rhodes</strong>. The <strong>Mobile Framework for Ruby</strong>.</p>
<p>To install it, I went through the <a href="http://rhomobile.com/" target="_blank">Rhodes website</a> and followed the tutorials. I did:<br />
<code>pik use 187<br />
gem install rhodes</code></p>
<p>I got <strong>make error</strong> <img src='http://puneetpandey.com/wp-includes/images/smilies/icon_mad.gif' alt=':-x' class='wp-smiley' />  Why windows won&#8217;t work like the Linux does and why do we need to troubleshoot <strong>C-compiler</strong> problems?</p>
<p>Another day I spent to look around for a solution and finally came up with <strong>Devkit</strong>.</p>
<p><strong>Short Intro about Devkit</strong>: Devkit is a windows executable program, which creates <strong>native extensions</strong> for your Ruby gems, which uses C-complier.</p>
<p><strong>Installation</strong>: Download the Devkit (Development Kit) from <a href="http://rubyinstaller.org/downloads/" target="_blank">Ruby installer website</a>. After downloading, extract it to:<br />
<code>C:\devkit</code><br />
After extraction, open your command, go inside <strong>C:\devkit</strong> prompt and type:<br />
<code>ruby dk.rb init</code><br />
This will create the <strong>config.yml</strong> inside C:/devkit. Now you need to define all the Ruby versions inside that file, so that devkit will create native extensions for them. To do that, open that file and at the end of it, write these lines:</p>
<p><code>- C:\ruby<br />
- C:\Users\PC-name\.pik\rubies\Ruby-187-p330<br />
- C:\Users\PC-name\.pik\rubies\Ruby-192-p0</code></p>
<p>Once done save it and from the command prompt, type:<br />
<code>ruby dk.rb install</code><br />
and you should see something like this:</p>
<p>Awesome, easy steps, isn&#8217;t it? Now, what else you&#8217;re looking for? Go ahead, install any gem for any version of ruby without any hesitations <img src='http://puneetpandey.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Please let me know if you&#8217;re stuck or need any help. Good comments will always motivate me to write more and more and help the Ruby Community keep growing.</p>
<p>References taken from:</p>
<ul>
<li><a href="https://github.com/vertiginous/pik">https://github.com/vertiginous/pik</a></li>
<li><a href="http://rubyinstaller.org/downloads/">http://rubyinstaller.org/downloads/</a></li>
<li><a href="http://rhomobile.com/">http://rhomobile.com/</a></li>
</ul>
<div id="fb-root"></div>
<p><script src="http://connect.facebook.net/en_US/all.js#appId=207351342636825&amp;xfbml=1"></script><fb:like href="http://puneetpandey.com/2011/02/dont-hesitate-to-try-out-new-things-in-ruby/" send="false" width="450" show_faces="true" font="verdana"></fb:like></p>
]]></content:encoded>
			<wfw:commentRss>http://puneetpandey.com/2011/02/dont-hesitate-to-try-out-new-things-in-ruby/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Freeze gems in Rails 3 Application</title>
		<link>http://puneetpandey.com/2011/01/freeze-gems-in-rails-3-application/</link>
		<comments>http://puneetpandey.com/2011/01/freeze-gems-in-rails-3-application/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 09:10:19 +0000</pubDate>
		<dc:creator>Puneet Pandey</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[bundle install]]></category>
		<category><![CDATA[bundler]]></category>
		<category><![CDATA[freeze gems in rails 3]]></category>
		<category><![CDATA[localize gems in rails 3]]></category>
		<category><![CDATA[rails 3]]></category>

		<guid isPermaLink="false">http://puneetpandey.com/?p=122</guid>
		<description><![CDATA[I have seen lots of forum, where developers keep on asking: &#8220;How would I freeze the gems to my Rails-3 application?&#8221; Take this URL for example: http://bit.ly/gFzN6Z One developer says that: localize your gems by running this command: bundle install &#8211;vendor/gems Others refuses to go with this way. Here&#8217;s why? We are moving away from [...]]]></description>
			<content:encoded><![CDATA[<p>I have seen lots of forum, where developers keep on asking: &#8220;How would I freeze the gems to my Rails-3 application?&#8221;</p>
<p>Take this URL for example: http://bit.ly/gFzN6Z</p>
<p>One developer says that: localize your gems by running this command: <strong>bundle install &#8211;vendor/gems </strong></p>
<p>Others refuses to go with this way. Here&#8217;s why?</p>
<ul>
<li>We are moving away from the concepts of bundler</li>
<li>This will install the gem dependencies as well in your vendor/gems directory, which we don&#8217;t need at all. We need only those gems which are specific to our application.</li>
<li>You don&#8217;t need to unpack the gems and check them in to your app, because it doesn&#8217;t matter: you&#8217;re guaranteeing the same versions are being called regardless of where they are installed, which will likely vary from machine to machine anyways (.bundle/ should not be checked in to the repo) &#8211; so why stick another 60-80 MB of files into your repo that you won&#8217;t ever be changing or using?</li>
</ul>
<p>So, there is no way you can localize your gems in a Rails-3 application. There are other ways you can perform in order to better use of <strong>bundler gem</strong>.</p>
<ul>
<li>Use specific versions in your Gemfile and run <strong>bundle install &#8211;deployment</strong> on each target system where you need the exact gem versions.</li>
<li>While defining a new gem in <strong>Gemfile</strong>, assign a path to it. For example:<br />
      <code>gem 'paperclip', '2.3.15', :path => './vendor/gems/paperclip-2.3.15'</code><br />
      Bundler will assume that it has to get the gem from vendor/gems folder. Once you&#8217;re done. run <strong>bundle install</strong></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://puneetpandey.com/2011/01/freeze-gems-in-rails-3-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Validation in Paperclip</title>
		<link>http://puneetpandey.com/2010/10/custom-validation-in-paperclip/</link>
		<comments>http://puneetpandey.com/2010/10/custom-validation-in-paperclip/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 14:04:31 +0000</pubDate>
		<dc:creator>Puneet Pandey</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[custom paperclip validation]]></category>
		<category><![CDATA[paperclip]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[validation on content type with paperclip]]></category>

		<guid isPermaLink="false">http://puneetpandey.com/?p=118</guid>
		<description><![CDATA[In this short tutorial, I will explain you how you can add custom validation messages on the Attachment if you&#8217;re using Paperclip plugin or gem. Way 1. This will work if you&#8217;re running your rails application on Windows Machine. Solution: a) install mimetype-fu plugin. b) Once installed, open Model, where paperclip settings has been defined. [...]]]></description>
			<content:encoded><![CDATA[<p>In this short tutorial, I will explain you how you can <strong>add custom validation messages</strong> on the Attachment if you&#8217;re using <strong>Paperclip</strong> plugin or gem.</p>
<p>Way 1. This will work if you&#8217;re running your rails application on Windows Machine.<br />
Solution: a) install <a href="http://github.com/mattetti/mimetype-fu/" target="_blank">mimetype-fu</a> plugin.<br />
b) Once installed, open Model, where paperclip settings has been defined. In my case, its User Model. Open it and add:</p>
<blockquote><p>
has_attached_file :avatar<br />
validate :prohibited_ext<br />
protected<br />
  def prohibited_ext<br />
    errors.add(:avatar, &#8220;Format #{File.mime_type?(avatar.path)} is invalid!&#8221;) unless File.mime_type?(avatar.path) == &#8220;application/exe&#8221;<br />
  end
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://puneetpandey.com/2010/10/custom-validation-in-paperclip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrade Rails Performance</title>
		<link>http://puneetpandey.com/2010/08/upgrade-rails-performance/</link>
		<comments>http://puneetpandey.com/2010/08/upgrade-rails-performance/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 07:05:37 +0000</pubDate>
		<dc:creator>Puneet Pandey</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[easy tricks to enhance rails performance]]></category>
		<category><![CDATA[How to check performance of rails application]]></category>
		<category><![CDATA[How to minimise queries to increase performance of rails application]]></category>
		<category><![CDATA[How to upgrade rails performance]]></category>
		<category><![CDATA[Performance in rails]]></category>

		<guid isPermaLink="false">http://puneetpandey.com/?p=103</guid>
		<description><![CDATA[In this article, we will try to Enhance our rails application performance. To know, how is your rails application is performing on different environments, you must need some plugin or gem. There are many gems/plugins already available which you can use and analyze the performance. First of all, I would like to list down those, [...]]]></description>
			<content:encoded><![CDATA[<p>In this article, we will try to <strong><em>Enhance</em></strong> our rails application <strong><em>performance</em></strong>.</p>
<p>To know, how is your rails application is performing on different environments, you must need some plugin or gem. There are many gems/plugins already available which you can use and analyze the performance.</p>
<p>First of all, I would like to list down those, which I will cover in my next tutorials.</p>
<ul>
<li><strong><a href="http://www.newrelic.com/">New Relic</a></strong></li>
<li><strong><a href="http://github.com/brynary/rack-bug">Rack Bug</a></strong></li>
<li><strong><a href="http://github.com/wvanbergen/request-log-analyzer/wiki">Rails Log Analyzer</a></strong></li>
<li><strong><a href="http://github.com/rdp/ruby-prof">Ruby Prof</a></strong></li>
</ul>
<p>Once you configure anyone of those, you&#8217;ll come to know how is your rails application is performing. I personally advise to use <strong>New Relic</strong> or <strong>Rack-Bug</strong>.</p>
<p>There are several ways, where you can upgrade you rails application performance. Let&#8217;s see what are those and how they work&#8230;</p>
<ul>
<li><strong>Enable Caching</strong></li>
<li><strong>Load Less SQL Queries</strong></li>
<li><strong>Avoid using before_filter for loading heavy data</strong></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://puneetpandey.com/2010/08/upgrade-rails-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joins in SQL</title>
		<link>http://puneetpandey.com/2010/08/joins-in-sql/</link>
		<comments>http://puneetpandey.com/2010/08/joins-in-sql/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 10:05:59 +0000</pubDate>
		<dc:creator>Puneet Pandey</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[what is join]]></category>
		<category><![CDATA[what is the difference between inner join and left outer join]]></category>

		<guid isPermaLink="false">http://puneetpandey.com/?p=82</guid>
		<description><![CDATA[Sometimes, its very hard to keep Joins concept in mind.. Being a beginner, experienced SQL programmer, you should know the concept of JOINS. In this article, I will show you the difference between: 1. JOINS and INCLUDE 2. How to you use JOINS in rails 3. JOINS over INCLUDE 4. JOINS and INCLUDE in RAILS-3 [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, its very hard to keep Joins concept in mind.. Being a beginner, experienced SQL programmer, you should know the concept of JOINS.</p>
<p>In this article, I will show you the difference between:<br />
1.<strong> JOINS</strong> and <strong>INCLUDE</strong><br />
2.<strong> How to you use JOINS in rails</strong><br />
3.<strong> JOINS over INCLUDE</strong><br />
4. <strong> JOINS and INCLUDE in RAILS-3 </strong></p>
<p>Let&#8217;s cover them in detail:<br />
<strong>What is Join ?</strong><br />
The SQL JOIN clause is used whenever we have to select data from 2 or more tables.</p>
<p>To be able to use SQL JOIN clause to extract data from 2 (or more) tables, we need a relationship between certain columns in these tables.</p>
<p><strong>Joins Type</strong><br />
1. OUTER JOIN<br />
1.a. LEFT OUTER JOIN<br />
1.b. RIGHT OUTER JOIN<br />
2. Inner Join</p>
<p>Let&#8217;s take an example here:</p>
<p><a href="http://puneetpandey.com/wp-content/uploads/2010/08/joins_example.bmp"><img src="http://puneetpandey.com/wp-content/uploads/2010/08/joins_example.bmp" alt="" title="joins_example" class="aligncenter size-full wp-image-126" /></a></p>
<p>The <strong>INNER JOIN</strong> will select all rows from both tables as long as there is a match between the columns we are matching on. In case we have a customer in the Customers table, which still hasn&#8217;t made any orders (there are no entries for this customer in the Sales table), this customer will not be listed in the result of our SQL query above.</p>
<p>The second type of SQL JOIN is called <strong>SQL OUTER JOIN</strong>  and it has 2 sub-types called <strong>LEFT OUTER JOIN and RIGHT OUTER JOIN.</strong></p>
<p>The LEFT OUTER JOIN or simply LEFT JOIN (you can omit the OUTER keyword in most databases), selects all the rows from the first table listed after the FROM clause, no matter if they have matches in the second table.</p>
<p>So, far you must be cleared with what JOIN does!! Now, we will see what JOINS and INCLUDE gives us&#8230;.</p>
<p>Consider these two statements:<br />
<code><br />
<strong>User.find(:first, :include => :user_profiles)</strong><br />
<strong>User.find(:first, :joins => :albums)</strong><br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://puneetpandey.com/2010/08/joins-in-sql/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Send Tweets from Rails Application</title>
		<link>http://puneetpandey.com/2010/08/send-tweets-from-rails-application/</link>
		<comments>http://puneetpandey.com/2010/08/send-tweets-from-rails-application/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 07:59:03 +0000</pubDate>
		<dc:creator>Puneet Pandey</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Click and send tweet from your rails application]]></category>
		<category><![CDATA[How to send tweets from rails application]]></category>
		<category><![CDATA[rails tweet]]></category>
		<category><![CDATA[Twitter API for Rails]]></category>
		<category><![CDATA[Twitter Integration with rails]]></category>
		<category><![CDATA[twitter4r]]></category>

		<guid isPermaLink="false">http://puneetpandey.com/?p=85</guid>
		<description><![CDATA[So, we&#8217;re continuing from here: http://puneetitengineer.wordpress.com/2009/08/12/send-tweets-fr…ls-application/ So far we&#8217;ve covered the basics of it, now its time to create some controllers&#8230;. Open your command/terminal and fire this command: ruby script/generate controller twitt Once you&#8217;re done, open this file and write the below code inside it: class TwittController < ApplicationController gem(&#8216;twitter4r&#8217;, &#8216;>=0.2.0&#8242;) require &#8216;twitter&#8217; require &#8216;twitter_search&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p>So, we&#8217;re continuing from here: <a href="http://puneetpandey.com/2010/08/send-tweets-from-rails-application/">http://puneetitengineer.wordpress.com/2009/08/12/send-tweets-fr…ls-application/</a></p>
<p>So far we&#8217;ve covered the basics of it, now its time to create some controllers&#8230;. Open your command/terminal and fire this command:</p>
<p><strong>ruby script/generate controller twitt</strong></p>
<p>Once you&#8217;re done, open this file and write the below code inside it:</p>
<blockquote><p>
class TwittController < ApplicationController</p>
<blockquote><p>
  gem(&#8216;twitter4r&#8217;, &#8216;>=0.2.0&#8242;)<br />
  require &#8216;twitter&#8217;<br />
  require &#8216;twitter_search&#8217;<br />
  require &#8216;rubygems&#8217;<br />
  before_filter :authorize, :except => [:login, :authenticate, :save_users, :twitter_cred]
  </p></blockquote>
<blockquote><p>
  def login<br />
    @user = User.new<br />
  end
  </p></blockquote>
<blockquote><p>
  def authenticate</p>
<blockquote><p>@user = User.new(params[:user])<br />
    client = Twitter::Client.new<br />
    if client.authenticate?(@user.username, @user.password)<br />
      @username = User.save_users(params[:user])<br />
      session[:user_id] = @user.id<br />
      session[:username] = @user.username<br />
      session[:password] = @user.password<br />
      redirect_to :action =>&#8217;post_status&#8217;<br />
    else<br />
      render :action =>&#8217;login&#8217;<br />
    end</p></blockquote>
<p>  end
  </p></blockquote>
<p>end
</p></blockquote>
<p>Now, open /app/views/twitt/login.html.erb and paste below lines:</p>
<blockquote><p>
<% form_for :user, :url => { :action => :authenticate } do |form| %></p>
<blockquote><p>
  <%= label :user, :username, "UserName:" %><br />
  <%= form.text_field :username, :size => 30 %>
  </p></blockquote>
<blockquote><p>
  <%= label :user, :password, "Password:" %><br />
  <%= form.password_field :password, :size => 30 %>
  </p></blockquote>
<p>  <%= submit_tag "login" , :class => &#8220;submit&#8221; %><br />
<% end %>
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://puneetpandey.com/2010/08/send-tweets-from-rails-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Integrate Oracle with Ruby</title>
		<link>http://puneetpandey.com/2010/06/integrate-oracle-with-ruby/</link>
		<comments>http://puneetpandey.com/2010/06/integrate-oracle-with-ruby/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 11:54:58 +0000</pubDate>
		<dc:creator>Puneet Pandey</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[How to integrate Ruby on Rails Application with Oracle Database]]></category>
		<category><![CDATA[How to integrate Ruby with Oracle]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle 10G with Ruby]]></category>
		<category><![CDATA[Puneet]]></category>
		<category><![CDATA[puneet on rails]]></category>
		<category><![CDATA[puneet pandey]]></category>
		<category><![CDATA[RoR with Oracle]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://puneetpandey.com/?p=64</guid>
		<description><![CDATA[Since most of the rails application is now using various databases, this article will show you how you can use ORACLE database with rails. For that, we need Oracle XE]]></description>
			<content:encoded><![CDATA[<p>Since most of the rails application is now using various databases, this article will show you how you can use <strong>ORACLE database</strong> with rails.</p>
<p>For that, we need <strong>Oracle XE</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://puneetpandey.com/2010/06/integrate-oracle-with-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

