<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Ruby on Rails</title>
	<atom:link href="http://satishonrails.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://satishonrails.wordpress.com</link>
	<description>Rails Programmer</description>
	<lastBuildDate>Thu, 30 Aug 2007 12:39:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='satishonrails.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Ruby on Rails</title>
		<link>http://satishonrails.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://satishonrails.wordpress.com/osd.xml" title="Ruby on Rails" />
	<atom:link rel='hub' href='http://satishonrails.wordpress.com/?pushpress=hub'/>
		<item>
		<title>How to load selective fixtures to db in rails</title>
		<link>http://satishonrails.wordpress.com/2007/08/30/how-to-load-selective-fixtures-to-db-in-rails/</link>
		<comments>http://satishonrails.wordpress.com/2007/08/30/how-to-load-selective-fixtures-to-db-in-rails/#comments</comments>
		<pubDate>Thu, 30 Aug 2007 12:38:17 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://satishonrails.wordpress.com/2007/08/30/how-to-load-selective-fixtures-to-db-in-rails/</guid>
		<description><![CDATA[loading fixture to db require rake db:fixtures:load To load a subset of your fixtures to your projects db rake db:fixtures:load FIXTURES=users,stores<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=satishonrails.wordpress.com&amp;blog=1558402&amp;post=12&amp;subd=satishonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>loading fixture to db require</p>
<pre><span class="code">rake db:fixtures:load </span></pre>
<p>To load a subset of your fixtures to your projects db</p>
<pre><span class="code">rake db:fixtures:load FIXTURES=users,stores</span></pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/satishonrails.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/satishonrails.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/satishonrails.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/satishonrails.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/satishonrails.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/satishonrails.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/satishonrails.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/satishonrails.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/satishonrails.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/satishonrails.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/satishonrails.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/satishonrails.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/satishonrails.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/satishonrails.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/satishonrails.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/satishonrails.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=satishonrails.wordpress.com&amp;blog=1558402&amp;post=12&amp;subd=satishonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://satishonrails.wordpress.com/2007/08/30/how-to-load-selective-fixtures-to-db-in-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f102f2c2410fba93e41ae9bc27d8feb3?s=96&#38;d=identicon" medium="image">
			<media:title type="html">satish</media:title>
		</media:content>
	</item>
		<item>
		<title>Star rating in ruby on rails</title>
		<link>http://satishonrails.wordpress.com/2007/08/30/star-rating-in-ruby-on-rails/</link>
		<comments>http://satishonrails.wordpress.com/2007/08/30/star-rating-in-ruby-on-rails/#comments</comments>
		<pubDate>Thu, 30 Aug 2007 12:33:35 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[rating]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://satishonrails.wordpress.com/2007/08/30/star-rating-in-ruby-on-rails/</guid>
		<description><![CDATA[Recently I needed to implement star rating system for one of my project I am working on. If you are not familiar with a star rating system, its simply a method of voting using (usually) 5 stars in a row, which will change colour as you hover over them indicating the level at which to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=satishonrails.wordpress.com&amp;blog=1558402&amp;post=13&amp;subd=satishonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="justification"> Recently I needed to implement star rating system for one of my project I am working on.</p>
<p class="justification">If you are not familiar with a star rating system, its simply a method of voting using (usually) 5 stars in a row, which will change colour as you hover over them indicating the level at which to rate something. You may think a simple rollover would accomplish this but difficulty arises because as you rollover each star it should stay highlighted while you light up the next one and so on until the end of the row of stars.</p>
<p class="justification">&nbsp;</p>
<p><strong>Install the acts_as_rateable plugin. </strong></p>
<p>Run the following from the root of your Rails app to install the plugin</p>
<p><span><span>script/plugin install http://juixe.com/svn/acts_as_rateable  </span></span></p>
<p>or<br />
http://rubyforge.org/projects/rateableplugin/</p>
<p>You can original post  at<a href="http://satishchauhan.com"> http//:satishchauhan.com </a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/satishonrails.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/satishonrails.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/satishonrails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/satishonrails.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/satishonrails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/satishonrails.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/satishonrails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/satishonrails.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/satishonrails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/satishonrails.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/satishonrails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/satishonrails.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/satishonrails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/satishonrails.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/satishonrails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/satishonrails.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=satishonrails.wordpress.com&amp;blog=1558402&amp;post=13&amp;subd=satishonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://satishonrails.wordpress.com/2007/08/30/star-rating-in-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f102f2c2410fba93e41ae9bc27d8feb3?s=96&#38;d=identicon" medium="image">
			<media:title type="html">satish</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Paginate With Ajax</title>
		<link>http://satishonrails.wordpress.com/2007/08/08/how-to-paginate-with-ajax/</link>
		<comments>http://satishonrails.wordpress.com/2007/08/08/how-to-paginate-with-ajax/#comments</comments>
		<pubDate>Wed, 08 Aug 2007 04:35:42 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[paginate]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://satishonrails.wordpress.com/2007/08/08/how-to-paginate-with-ajax/</guid>
		<description><![CDATA[Pagination is a very common task in web application development. But sometimes we need to paginate something with ajax request. The interest to use Ajax for this is to provide a dynamic interface which doesn’t need to reload the entire page when next results(page) displayed. Ajax is really nicely integrated with Rails, and using it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=satishonrails.wordpress.com&amp;blog=1558402&amp;post=11&amp;subd=satishonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Pagination is a very common task in web application development. But sometimes we need to paginate something with ajax request. The interest to use Ajax for this is to provide a dynamic interface which doesn’t need to reload the entire page when next results(page) displayed. Ajax is really nicely integrated with Rails, and using it is very easier with this great framework. To work with ajax requests your browser must be enabled to handled java script requests. I knew two methods for that problem.</p>
<p><strong>This is posted on </strong><a href="http://www.satishchauhan.com"><strong>satish&#8217;s blog</strong></a></p>
<p><strong>For more details <a href="http://satishchauhan.com" target="_blank">click here </a></strong></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/satishonrails.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/satishonrails.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/satishonrails.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/satishonrails.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/satishonrails.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/satishonrails.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/satishonrails.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/satishonrails.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/satishonrails.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/satishonrails.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/satishonrails.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/satishonrails.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/satishonrails.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/satishonrails.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/satishonrails.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/satishonrails.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=satishonrails.wordpress.com&amp;blog=1558402&amp;post=11&amp;subd=satishonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://satishonrails.wordpress.com/2007/08/08/how-to-paginate-with-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f102f2c2410fba93e41ae9bc27d8feb3?s=96&#38;d=identicon" medium="image">
			<media:title type="html">satish</media:title>
		</media:content>
	</item>
		<item>
		<title>How to import CSV file in rails</title>
		<link>http://satishonrails.wordpress.com/2007/07/18/how-to-import-csv-file-in-rails/</link>
		<comments>http://satishonrails.wordpress.com/2007/07/18/how-to-import-csv-file-in-rails/#comments</comments>
		<pubDate>Wed, 18 Jul 2007 12:47:16 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[CSV]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://satishonrails.wordpress.com/2007/07/18/how-to-import-csv-file-in-rails/</guid>
		<description><![CDATA[How to import CSV file in rails? The CSV text-file format is a common choice for both import and export when performing data migrations. What if you want to import CSV files within a Rails application? Here is the code that allow you to upload CSV data onto the MySQL database from the web interface [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=satishonrails.wordpress.com&amp;blog=1558402&amp;post=10&amp;subd=satishonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>How to import CSV file in rails?</p>
<p>The <span class="caps">CSV</span> text-file format is a common choice for both import and export when performing data migrations. What if you want to import <span class="caps">CSV</span> files within a Rails application?</p>
<p>Here is the code that <font size="1"><font size="2">allow you to upload CSV data onto the MySQL database from the web interface</font></font><br />
This code save data direct to database without saving it to temp file</p>
<p><strong>Controller: </strong></p>
<pre>
<strong>    require</strong> 'csv'

   <strong>def csv_import </strong>
     @parsed_file=CSV::Reader.parse(params[:dump][:file])
     n=0
     @parsed_file.each  do |row|
     c=CustomerInformation.new
     c.job_title=row[1]
     c.first_name=row[2]
     c.last_name=row[3]
     <strong>if</strong> c.save
        n=n+1
        GC.start if n%50==0
     <strong>end</strong>
     flash.now[:message]="CSV Import Successful,  #{n} new records added to data base"
   <strong>end</strong></pre>
<p><strong>View:</strong><br />
your view will look like</p>
<pre>
 &lt;% <strong>form_for</strong> :dump, :url=&gt;{:controller=&gt;"customer_informations", :action=&gt;"csv_import"}, :html =&gt; { :multipart =&gt; true } do |f| -%&gt;
 &lt;table"&gt;
   &lt;tr&gt;
     &lt;td&gt;
      &lt;label for="dump_file"&gt;
        Select a CSV File :
      &lt;/label&gt;
     &lt;/td&gt;
     &lt;td &gt;
       &lt;%= f.file_field :file -%&gt;
     &lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
     &lt;td colspan='2'&gt;
       &lt;%= submit_tag 'Submit' -%&gt;
     &lt;/td&gt;
   &lt;/tr&gt;
 &lt;/table&gt;
&lt;% end -%&gt;</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/satishonrails.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/satishonrails.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/satishonrails.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/satishonrails.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/satishonrails.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/satishonrails.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/satishonrails.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/satishonrails.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/satishonrails.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/satishonrails.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/satishonrails.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/satishonrails.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/satishonrails.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/satishonrails.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/satishonrails.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/satishonrails.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=satishonrails.wordpress.com&amp;blog=1558402&amp;post=10&amp;subd=satishonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://satishonrails.wordpress.com/2007/07/18/how-to-import-csv-file-in-rails/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f102f2c2410fba93e41ae9bc27d8feb3?s=96&#38;d=identicon" medium="image">
			<media:title type="html">satish</media:title>
		</media:content>
	</item>
		<item>
		<title>Varify Email address Format</title>
		<link>http://satishonrails.wordpress.com/2007/07/03/varify-email-address-format/</link>
		<comments>http://satishonrails.wordpress.com/2007/07/03/varify-email-address-format/#comments</comments>
		<pubDate>Tue, 03 Jul 2007 11:07:02 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Regexp]]></category>
		<category><![CDATA[ror]]></category>

		<guid isPermaLink="false">http://satishonrails.wordpress.com/2007/07/03/varify-email-address-format/</guid>
		<description><![CDATA[Varify Email address Format Useful expressions for email address validation Matches a limited version of the RFC 2822 addr-spec form. /A(?:[w!#$%&#38;'*+-/=?^`{&#124;}~]+.)*[w!#$%&#38;*+-/=?^`{&#124;}~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]?!.)){0,61}[a-zA-Z0-9]?.)+[a-zA-Z0-9](?:[a-zA-Z0-9-](?!$)){0,61}a-zA-Z0-9]?)&#124;(?:[(?:(?:[01]?d{1,2}&#124;2[0-4]d&#124;25[0-5]).){3}(?:[01]d{1,2}&#124;2[0-4]d&#124;25[0-5])]))Z/i satish chauhan<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=satishonrails.wordpress.com&amp;blog=1558402&amp;post=9&amp;subd=satishonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>Varify Email address Format</h3>
<p>Useful expressions for email address validation</p>
<p>Matches a limited version of the RFC 2822 addr-spec form.</p>
<pre>
/A(?:[w!#$%&amp;'*+-/=?^`{|}~]+.)*[w!#$%&amp;*+-/=?^`{|}~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]?!.)){0,61}[a-zA-Z0-9]?.)+[a-zA-Z0-9](?:[a-zA-Z0-9-](?!$)){0,61}a-zA-Z0-9]?)|(?:[(?:(?:[01]?d{1,2}|2[0-4]d|25[0-5]).){3}(?:[01]d{1,2}|2[0-4]d|25[0-5])]))Z/i</pre>
<pre></pre>
<pre><a href="http://satishchauhan.blogspot.com">satish chauhan</a></pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/satishonrails.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/satishonrails.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/satishonrails.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/satishonrails.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/satishonrails.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/satishonrails.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/satishonrails.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/satishonrails.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/satishonrails.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/satishonrails.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/satishonrails.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/satishonrails.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/satishonrails.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/satishonrails.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/satishonrails.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/satishonrails.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=satishonrails.wordpress.com&amp;blog=1558402&amp;post=9&amp;subd=satishonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://satishonrails.wordpress.com/2007/07/03/varify-email-address-format/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f102f2c2410fba93e41ae9bc27d8feb3?s=96&#38;d=identicon" medium="image">
			<media:title type="html">satish</media:title>
		</media:content>
	</item>
		<item>
		<title>Multiple Checkboxes with HABTM</title>
		<link>http://satishonrails.wordpress.com/2007/06/29/multiple-checkboxes-with-habtm/</link>
		<comments>http://satishonrails.wordpress.com/2007/06/29/multiple-checkboxes-with-habtm/#comments</comments>
		<pubDate>Fri, 29 Jun 2007 09:36:01 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[CSV]]></category>
		<category><![CDATA[HABTM]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ror]]></category>

		<guid isPermaLink="false">http://satishonrails.wordpress.com/2007/06/29/multiple-checkboxes-with-habtm/</guid>
		<description><![CDATA[Has and Belongs to Many with Multiple Check boxes So if you are trying to do a multiple select of checkboxes and using habtm in your project, but when you submit the form, only one value was available in your controller. While you try to edit records in database but because of some error you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=satishonrails.wordpress.com&amp;blog=1558402&amp;post=8&amp;subd=satishonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Has and Belongs to Many with Multiple Check boxes</p>
<p>So if you are trying to do a multiple select of checkboxes and using habtm in your project, but when you submit the form, only one value was available in your controller. While you try to edit records in database but because of some error you get back to the pre field form and you found   that the checkboxes checked by you gone ,then here’s the solution</p>
<p><strong>Model:</strong></p>
<pre>	class Customer &lt; ActiveRecord::Base
		has_and_belongs_to_many :intrests
	end</pre>
<p><strong>Controller code:</strong></p>
<pre>class CustomersController &lt; ApplicationController
   def create
      if request.post?
         @customer=Customer.new(params[:customer])
         @customer.save
      end
   end

   def edit
      @customer=Customer.find_by_id(params[:id]) if params[:id]
      if @customer
         if request.post?
            if @customer.update_attributes(customer)
               flash.now[:message]="Update successfully "
            end
         end
      else
        flash[:message]="Page requested by you does not exists"
      end
   end
end</pre>
<p><strong>Your View:</strong></p>
<pre>
 &lt;% form_for :customer,  do |f| -%&gt;
    First Name:
      &lt;%= f.text_field :first_name  -%&gt;
    Last Name:
      &lt;%= f.text_field :last_name -%&gt;
      &lt;% <strong>for</strong>  intr in <strong>total_intrests</strong> -%&gt;
         &lt;%= check_box_tag "customer[interest_ids][]", "#{intr.id}", interest(intr) -%&gt; # interest is a helper method
         &lt;%= "#{intr.name}" -%&gt;
      &lt;% end -%&gt;
   &lt;% end -%&gt;</pre>
<p>helper method</p>
<pre>
   def interest(i)
      if @customer
         @customer.interests.include?(i)
      else
        false
      end
   end</pre>
<p>View generate a checkbox for every interest(all_interest=Interest.find(:all)). The name of the input is significant obviously. The trailing “[]” on the name means the end result will be the list of checked ids. This list will be stored on the @params['customer'] hash with the key ‘interest_ids’. When the controller calls @customer.update_attributes(@params[:customer]), it tries to call @customer.key= for each of the keys on @params[:customer]. What’s important to realize is that these keys don’t have to actually be attributes on the Customer model. All that’s important is that there’s a key= method on the model. Model automatically contains a “collection_ids=” method for habtm and has-many associations.</p>
<p>This method will load the objects identified by the ids and call the “interest=(list)” method on the model with the freshly loaded list. This method in turn, will compare the list to the current list of interests and delete/add interests as necessary.<span id="more-8"></span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/satishonrails.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/satishonrails.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/satishonrails.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/satishonrails.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/satishonrails.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/satishonrails.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/satishonrails.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/satishonrails.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/satishonrails.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/satishonrails.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/satishonrails.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/satishonrails.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/satishonrails.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/satishonrails.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/satishonrails.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/satishonrails.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=satishonrails.wordpress.com&amp;blog=1558402&amp;post=8&amp;subd=satishonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://satishonrails.wordpress.com/2007/06/29/multiple-checkboxes-with-habtm/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f102f2c2410fba93e41ae9bc27d8feb3?s=96&#38;d=identicon" medium="image">
			<media:title type="html">satish</media:title>
		</media:content>
	</item>
		<item>
		<title>How to generate CSV files in Rails</title>
		<link>http://satishonrails.wordpress.com/2007/06/28/how-to-generate-csv-files-in-rails/</link>
		<comments>http://satishonrails.wordpress.com/2007/06/28/how-to-generate-csv-files-in-rails/#comments</comments>
		<pubDate>Thu, 28 Jun 2007 12:30:08 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[CSV]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ror]]></category>

		<guid isPermaLink="false">http://satishonrails.wordpress.com/2007/06/28/how-to-generate-csv-files-in-rails/</guid>
		<description><![CDATA[Controller code : require 'csv' def export_to_csv@customers=CustomerInformation.find(:all) report = StringIO.new CSV::Writer.generate(report, ',') do &#124;title&#124; title &#60;&#60; ['Id', 'Title', 'Job Title', 'First Name', 'Last Name'] @customers.each do &#124;c&#124; title &#60; 'text/csv; charset=iso-8859-1; header=present',:filename =&#62; 'report.csv', :disposition =&#62;'attachment', :encoding =&#62; 'utf8') end end end View: &#60;% form_tag({ :action =&#62; :export_to_csv })do -%&#62; &#60;%= submit_tag "Export To CSV" [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=satishonrails.wordpress.com&amp;blog=1558402&amp;post=7&amp;subd=satishonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Controller code :</p>
<pre>
require 'csv'
   def export_to_csv@customers=CustomerInformation.find(:all)
      report = StringIO.new
      CSV::Writer.generate(report, ',') do |title|
         title &lt;&lt; ['Id', 'Title', 'Job Title', 'First Name', 'Last Name']
         @customers.each do |c|
            title &lt; 'text/csv; charset=iso-8859-1; header=present',:filename =&gt; 'report.csv', :disposition =&gt;'attachment', :encoding =&gt; 'utf8')
         end
      end
   end
</pre>
<p><strong>View: </strong></p>
<pre>    &lt;% form_tag({ :action =&gt;  :export_to_csv })do -%&gt;
       &lt;%= submit_tag "Export To CSV" -%&gt;
    &lt;% end -%&gt;</pre>
</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/satishonrails.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/satishonrails.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/satishonrails.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/satishonrails.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/satishonrails.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/satishonrails.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/satishonrails.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/satishonrails.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/satishonrails.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/satishonrails.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/satishonrails.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/satishonrails.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/satishonrails.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/satishonrails.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/satishonrails.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/satishonrails.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=satishonrails.wordpress.com&amp;blog=1558402&amp;post=7&amp;subd=satishonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://satishonrails.wordpress.com/2007/06/28/how-to-generate-csv-files-in-rails/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f102f2c2410fba93e41ae9bc27d8feb3?s=96&#38;d=identicon" medium="image">
			<media:title type="html">satish</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world!</title>
		<link>http://satishonrails.wordpress.com/2007/06/27/hello-world-2/</link>
		<comments>http://satishonrails.wordpress.com/2007/06/27/hello-world-2/#comments</comments>
		<pubDate>Wed, 27 Jun 2007 12:33:58 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://satishonrails.wordpress.com/2007/06/27/hello-world-2/</guid>
		<description><![CDATA[Welcome to Satish Chauhan&#8217;s blog. This is my first post.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=satishonrails.wordpress.com&amp;blog=1558402&amp;post=4&amp;subd=satishonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Welcome to <a href="http://satishchauhan.com" title="satish chauhan" target="_blank">Satish Chauhan&#8217;s</a> blog. <a href="http://wordpress.com/"></a> This is my first post.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/satishonrails.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/satishonrails.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/satishonrails.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/satishonrails.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/satishonrails.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/satishonrails.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/satishonrails.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/satishonrails.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/satishonrails.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/satishonrails.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/satishonrails.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/satishonrails.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/satishonrails.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/satishonrails.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/satishonrails.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/satishonrails.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=satishonrails.wordpress.com&amp;blog=1558402&amp;post=4&amp;subd=satishonrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://satishonrails.wordpress.com/2007/06/27/hello-world-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f102f2c2410fba93e41ae9bc27d8feb3?s=96&#38;d=identicon" medium="image">
			<media:title type="html">satish</media:title>
		</media:content>
	</item>
	</channel>
</rss>
