<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Articles form Satish Chauhan's Ruby on Rails blog</title>
    <link>http://www.satishchauhan.com/</link>
    <pubDate>Thu, 08 May 2008 12:50:29 GMT</pubDate>
    <description>Articles created by Satish Chauhan.</description>
    <item>
      <title>How to install web server on ubuntu</title>
      <link>http://www.satishchauhan.com/articles/show_comments/12</link>
      <description>&lt;p&gt;Here is the step-by-step procedure to install apache web server on your machine&amp;lt;br/&amp;gt;
&lt;br /&gt;&amp;lt;b&amp;gt;install apache&amp;lt;/b&amp;gt;
&lt;br /&gt;&amp;lt;pre&amp;gt;
&lt;br /&gt; satish@satish-laptop:~$ sudo apt-get install apache2
&lt;br /&gt;&amp;lt;/pre&amp;gt;&amp;lt;b&amp;gt;test it&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;
&lt;br /&gt;surf to your own server on your own local computer:
&lt;br /&gt;&amp;lt;pre&amp;gt;
&lt;br /&gt; satish@satish-laptop:~$ firefox &amp;quot;http://localhost&amp;quot;
&lt;br /&gt;&amp;lt;/pre&amp;gt;
&lt;br /&gt;find out how your server is found on the net. anyone can use your ip address or dns name to connect to your server:
&lt;br /&gt;&amp;lt;pre&amp;gt;
&lt;br /&gt; satish@satish-laptop:~$ ip addr
&lt;br /&gt; =&amp;gt;1.2.3.4
&lt;br /&gt;&amp;lt;/pre&amp;gt;use your own ip address (eth0, first ip number, does not end .255)
&lt;br /&gt;&amp;lt;pre&amp;gt;
&lt;br /&gt; satish@satish-laptop:~$ fi...&lt;/p&gt;</description>
      <pubDate>Thu, 08 May 2008 12:50:29 GMT</pubDate>
      <guid>http://www.satishchauhan.com/articles/showcomments/12</guid>
      <author>satish</author>
    </item>
    <item>
      <title>Bar camp delhi 3 </title>
      <link>http://www.satishchauhan.com/articles/show_comments/11</link>
      <description>&lt;p&gt;Saturday (7th dec, 2007) i was at barcampdelhi3 held in impetus technologies, noida &lt;/p&gt;

&lt;p&gt;this was my first barcamp and i enjoyed this very much&lt;/p&gt;

&lt;p&gt;to find more details about the event, sessions held &amp;lt;a href='http://barcamp.org/barcampdelhi3'&amp;gt;click here&amp;lt;/a&amp;gt;&lt;/p&gt;</description>
      <pubDate>Mon, 10 Dec 2007 05:46:04 GMT</pubDate>
      <guid>http://www.satishchauhan.com/articles/showcomments/11</guid>
      <author>satish</author>
    </item>
    <item>
      <title>How to load selective fixtures to db in rails</title>
      <link>http://www.satishchauhan.com/articles/show_comments/9</link>
      <description>&lt;p&gt;All of you know how to load fixture to db&lt;/p&gt;

&lt;p&gt;&amp;lt;pre&amp;gt;rake db:fixtures:load&amp;lt;/pre&amp;gt; &lt;/p&gt;

&lt;p&gt;to load a subset of your fixtures to your projects db&lt;/p&gt;

&lt;p&gt;&amp;lt;pre&amp;gt;rake db:fixtures:load fixtures=users,stores&amp;lt;/pre&amp;gt;&lt;/p&gt;</description>
      <pubDate>Wed, 17 Oct 2007 13:13:55 GMT</pubDate>
      <guid>http://www.satishchauhan.com/articles/showcomments/9</guid>
      <author>satish</author>
    </item>
    <item>
      <title>Star rating in ruby on rails</title>
      <link>http://www.satishchauhan.com/articles/show_comments/8</link>
      <description>&lt;p&gt;Recently i needed to implement star rating system for one of my project i am working on.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;if this doesnt make much sense to you then take a look at what we are going ...&lt;/p&gt;</description>
      <pubDate>Wed, 17 Oct 2007 13:07:51 GMT</pubDate>
      <guid>http://www.satishchauhan.com/articles/showcomments/8</guid>
      <author>satish</author>
    </item>
    <item>
      <title>How to paginate with ajax</title>
      <link>http://www.satishchauhan.com/articles/show_comments/7</link>
      <description>&lt;p&gt;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&#8217;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.&lt;/p&gt;

&lt;p&gt;&amp;lt;br&amp;gt;
&lt;br /&gt;&amp;lt;b&amp;gt;first method&amp;lt;/b&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;b&amp;gt;your controller code&amp;lt;/b&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;pre&amp;gt;
&lt;br /&gt;  def ajax_pagination_lin...&lt;/p&gt;</description>
      <pubDate>Wed, 17 Oct 2007 13:04:52 GMT</pubDate>
      <guid>http://www.satishchauhan.com/articles/showcomments/7</guid>
      <author>satish</author>
    </item>
    <item>
      <title>How to use syntaxhighlighter</title>
      <link>http://www.satishchauhan.com/articles/show_comments/6</link>
      <description>&lt;p&gt;&amp;lt;b&amp;gt;syntaxhighlighter:&amp;lt;/b&amp;gt;&lt;/p&gt;

&lt;p&gt;syntaxhighlighter is a source code syntax highlighting plugin to help a developer/coder to post code snippets online with ease and and without having to worry about applying format. it is a free javascript tool for source code syntex highlighting , it doesn&#8217;t care what you have on your server.&lt;/p&gt;

&lt;p&gt;the idea behind syntaxhighlighter is to allow insertion of colored code snippets on a web page without relying on any server side scripts.&lt;/p&gt;

&lt;p&gt;wp-dp.syntaxhighlighter supported languages:
&lt;br /&gt;&amp;lt;ul&amp;gt;
&lt;br /&gt;&amp;lt;li&amp;gt;c# &amp;lt;/li&amp;gt;
&lt;br /&gt;&amp;lt;li&amp;gt;css &amp;lt;/li&amp;gt;
&lt;br /&gt;&amp;lt;li&amp;gt;c++ &amp;lt;/li&amp;gt;
&lt;br /&gt;&amp;lt;li&amp;gt;vb &amp;amp; vb.net &amp;lt;/li&amp;gt;
&lt;br /&gt;&amp;lt;li&amp;gt;delph...&lt;/p&gt;</description>
      <pubDate>Wed, 17 Oct 2007 13:10:05 GMT</pubDate>
      <guid>http://www.satishchauhan.com/articles/showcomments/6</guid>
      <author>satish</author>
    </item>
    <item>
      <title>Varify email address format</title>
      <link>http://www.satishchauhan.com/articles/show_comments/4</link>
      <description>&lt;p&gt;&amp;lt;pre&amp;gt;
&lt;br /&gt;&amp;quot;/\a(?:[\w\!\#\$\%\&amp;amp;\&#8217;\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&amp;amp;\&#8217;\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[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&amp;quot;
&lt;br /&gt;&amp;lt;/pre&amp;gt;&lt;/p&gt;</description>
      <pubDate>Wed, 17 Oct 2007 13:03:53 GMT</pubDate>
      <guid>http://www.satishchauhan.com/articles/showcomments/4</guid>
      <author>satish</author>
    </item>
    <item>
      <title>Multiple checkboxes with habtm</title>
      <link>http://www.satishchauhan.com/articles/show_comments/3</link>
      <description>&lt;p&gt;Has and belongs to many with multiple check boxes&lt;/p&gt;

&lt;p&gt;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&#8217;s the solution&lt;/p&gt;

&lt;p&gt;&amp;lt;b&amp;gt;model:&amp;lt;/b&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;pre&amp;gt;
&lt;br /&gt;   class customer &amp;lt; activerecord::base
&lt;br /&gt;     has_and_belongs_to_many :intrests
&lt;br /&gt;   end
&lt;br /&gt;&amp;lt;/pre&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;b&amp;gt;controller code:&amp;lt;/b&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;pre&amp;gt;
&lt;br /&gt;    class customerscontroller &amp;lt;...&lt;/p&gt;</description>
      <pubDate>Wed, 17 Oct 2007 13:03:03 GMT</pubDate>
      <guid>http://www.satishchauhan.com/articles/showcomments/3</guid>
      <author>satish</author>
    </item>
    <item>
      <title>How to import csv file in rails</title>
      <link>http://www.satishchauhan.com/articles/show_comments/5</link>
      <description>&lt;p&gt;How to import csv file in rails?&lt;/p&gt;

&lt;p&gt;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?&lt;/p&gt;

&lt;p&gt;here is the code that allow you to upload csv data onto the mysql database from the web interface
&lt;br /&gt;this code save data direct to database without saving it to temp file&lt;/p&gt;

&lt;p&gt;&amp;lt;b&amp;gt;controller:&amp;lt;/b&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;pre&amp;gt;
&lt;br /&gt;    require &#8216;csv&#8217;&lt;/p&gt;

&lt;p&gt;   def csv_import 
&lt;br /&gt;     @parsed_file=csv::reader.parse(params[:dump][:file])
&lt;br /&gt;     n=0
&lt;br /&gt;     @parsed_file.each  do |row|
&lt;br /&gt;     c=customerinformation.new
&lt;br /&gt;     c.job...&lt;/p&gt;</description>
      <pubDate>Wed, 17 Oct 2007 13:02:20 GMT</pubDate>
      <guid>http://www.satishchauhan.com/articles/showcomments/5</guid>
      <author>satish</author>
    </item>
    <item>
      <title>How to generate csv files in rails</title>
      <link>http://www.satishchauhan.com/articles/show_comments/10</link>
      <description>&lt;p&gt;The csv text-file format is a common choice for both import and export when performing data migrations. what if you want to generate csv files from the database records and want to export within a rails application?&lt;/p&gt;

&lt;p&gt;here is the code that allow you to generate csv file form the database records
&lt;br /&gt;&amp;lt;br&amp;gt;
&lt;br /&gt;&amp;lt;b&amp;gt;controller: &amp;lt;/b&amp;gt;
&lt;br /&gt;&amp;lt;pre&amp;gt;
&lt;br /&gt; require 'csv'&lt;/p&gt;

&lt;p&gt; def export_to_csv
&lt;br /&gt;   @customers=customerinformation.find(:all)
&lt;br /&gt;   report = stringio.new
&lt;br /&gt;      csv::writer.generate(report, ',') do |title|
&lt;br /&gt;        title &amp;lt;&amp;lt; ['id','job title','first name','last name']
&lt;br /&gt;        @customers.each do |c|
&lt;br /&gt;        ...&lt;/p&gt;</description>
      <pubDate>Thu, 18 Oct 2007 04:17:33 GMT</pubDate>
      <guid>http://www.satishchauhan.com/articles/showcomments/10</guid>
      <author>satish</author>
    </item>
  </channel>
</rss>
