<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7690752520033688218</id><updated>2012-01-24T12:32:10.723+05:30</updated><category term='ror'/><category term='fixtures'/><category term='ruby on rails'/><category term='rating'/><category term='rails'/><title type='text'>Satish Chauhan's Ruby on Rails Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://satishchauhan.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://satishchauhan.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Satish Chauhan</name><uri>http://www.blogger.com/profile/18110582246882842782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://2.bp.blogspot.com/_cfun81NILsU/SgE8Jb_FAII/AAAAAAAAABg/B51goKLDAds/S220/satish_thumb.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7690752520033688218.post-5475295518859878194</id><published>2009-01-01T22:59:00.000+05:30</published><updated>2009-01-07T23:14:03.827+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ror'/><category scheme='http://www.blogger.com/atom/ns#' term='ruby on rails'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><title type='text'>Rounded Corners Using Pure CSS Without Images And Javascript</title><content type='html'>Please follow the link below&lt;br /&gt;&lt;br /&gt;&lt;a href="http://satishchauhan.com/2009/01/01/rounded-corners-using-pure-css-without-images-and-javascript/"&gt;http://satishchauhan.com/2009/01/01/rounded-corners-using-pure-css-without-images-and-javascript/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7690752520033688218-5475295518859878194?l=satishchauhan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishchauhan.blogspot.com/feeds/5475295518859878194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7690752520033688218&amp;postID=5475295518859878194' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/5475295518859878194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/5475295518859878194'/><link rel='alternate' type='text/html' href='http://satishchauhan.blogspot.com/2009/01/rounded-corners-using-pure-css-without.html' title='Rounded Corners Using Pure CSS Without Images And Javascript'/><author><name>Satish Chauhan</name><uri>http://www.blogger.com/profile/18110582246882842782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://2.bp.blogspot.com/_cfun81NILsU/SgE8Jb_FAII/AAAAAAAAABg/B51goKLDAds/S220/satish_thumb.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7690752520033688218.post-615521884429100197</id><published>2008-12-30T22:00:00.000+05:30</published><updated>2009-01-07T23:16:49.878+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ror'/><category scheme='http://www.blogger.com/atom/ns#' term='ruby on rails'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><title type='text'>Dynamic Scope Methods in Edge Rails</title><content type='html'>Please follow the link below&lt;br /&gt;&lt;br /&gt;&lt;a href="http://satishchauhan.com/2008/12/30/dynamic-scope-methods-in-edge-rails/"&gt;http://satishchauhan.com/2008/12/30/dynamic-scope-methods-in-edge-rails/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7690752520033688218-615521884429100197?l=satishchauhan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishchauhan.blogspot.com/feeds/615521884429100197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7690752520033688218&amp;postID=615521884429100197' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/615521884429100197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/615521884429100197'/><link rel='alternate' type='text/html' href='http://satishchauhan.blogspot.com/2009/01/dynamic-scope-methods-in-edge-rails.html' title='Dynamic Scope Methods in Edge Rails'/><author><name>Satish Chauhan</name><uri>http://www.blogger.com/profile/18110582246882842782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://2.bp.blogspot.com/_cfun81NILsU/SgE8Jb_FAII/AAAAAAAAABg/B51goKLDAds/S220/satish_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7690752520033688218.post-232421721874415300</id><published>2008-12-28T21:56:00.000+05:30</published><updated>2009-01-07T23:15:13.357+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ror'/><category scheme='http://www.blogger.com/atom/ns#' term='ruby on rails'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><title type='text'>Merb gets merged into Rails 3</title><content type='html'>Ruby on Rails and Merb team decided to  merge both of the frameworks into a singular web framework in Rails 3. The two frameworks have much in common and share code in a variety of places.&lt;br /&gt;&lt;br /&gt;Please click here to find the detailed post by DHH.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7690752520033688218-232421721874415300?l=satishchauhan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishchauhan.blogspot.com/feeds/232421721874415300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7690752520033688218&amp;postID=232421721874415300' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/232421721874415300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/232421721874415300'/><link rel='alternate' type='text/html' href='http://satishchauhan.blogspot.com/2009/01/merb-gets-merged-into-rails-3.html' title='Merb gets merged into Rails 3'/><author><name>Satish Chauhan</name><uri>http://www.blogger.com/profile/18110582246882842782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://2.bp.blogspot.com/_cfun81NILsU/SgE8Jb_FAII/AAAAAAAAABg/B51goKLDAds/S220/satish_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7690752520033688218.post-5735293203019205536</id><published>2007-08-30T18:12:00.001+05:30</published><updated>2007-08-30T18:15:17.946+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ror'/><category scheme='http://www.blogger.com/atom/ns#' term='ruby on rails'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='fixtures'/><title type='text'>How to load selective fixtures to db in rails</title><content type='html'>All of you must know how to load fixtures to db&lt;br /&gt;&lt;br /&gt;   rake db:fixtures:load &lt;br /&gt;&lt;br /&gt;To load a subset of your fixtures to your projects db&lt;br /&gt;&lt;br /&gt;   rake db:fixtures:load FIXTURES=users,stores&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7690752520033688218-5735293203019205536?l=satishchauhan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishchauhan.blogspot.com/feeds/5735293203019205536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7690752520033688218&amp;postID=5735293203019205536' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/5735293203019205536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/5735293203019205536'/><link rel='alternate' type='text/html' href='http://satishchauhan.blogspot.com/2007/08/how-to-load-selective-fixtures-to-db-in_30.html' title='How to load selective fixtures to db in rails'/><author><name>Satish Chauhan</name><uri>http://www.blogger.com/profile/18110582246882842782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://2.bp.blogspot.com/_cfun81NILsU/SgE8Jb_FAII/AAAAAAAAABg/B51goKLDAds/S220/satish_thumb.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7690752520033688218.post-1661015600573896528</id><published>2007-08-28T00:34:00.000+05:30</published><updated>2007-08-29T13:56:18.865+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ror'/><category scheme='http://www.blogger.com/atom/ns#' term='rating'/><category scheme='http://www.blogger.com/atom/ns#' term='ruby on rails'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><title type='text'>Star rating in ruby on rails</title><content type='html'>Recently I needed to implement star rating system for one of my project I am working on.&lt;br /&gt;&lt;br /&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;br /&gt;&lt;br /&gt;&lt;a href="http://satishchauhan.com"&gt;click here to find more details&gt;&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7690752520033688218-1661015600573896528?l=satishchauhan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishchauhan.blogspot.com/feeds/1661015600573896528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7690752520033688218&amp;postID=1661015600573896528' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/1661015600573896528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/1661015600573896528'/><link rel='alternate' type='text/html' href='http://satishchauhan.blogspot.com/2007/08/star-rating-in-ruby-on-rails.html' title='Star rating in ruby on rails'/><author><name>Satish Chauhan</name><uri>http://www.blogger.com/profile/18110582246882842782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://2.bp.blogspot.com/_cfun81NILsU/SgE8Jb_FAII/AAAAAAAAABg/B51goKLDAds/S220/satish_thumb.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7690752520033688218.post-5169042553770976935</id><published>2007-08-02T11:00:00.000+05:30</published><updated>2007-08-02T11:03:07.103+05:30</updated><title type='text'>How to Paginate With Ajax</title><content type='html'>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.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;For More details &lt;a href="http://www.satishchauhan.com"&gt;click here &gt;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7690752520033688218-5169042553770976935?l=satishchauhan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishchauhan.blogspot.com/feeds/5169042553770976935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7690752520033688218&amp;postID=5169042553770976935' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/5169042553770976935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/5169042553770976935'/><link rel='alternate' type='text/html' href='http://satishchauhan.blogspot.com/2007/08/how-to-paginate-with-ajax.html' title='How to Paginate With Ajax'/><author><name>Satish Chauhan</name><uri>http://www.blogger.com/profile/18110582246882842782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://2.bp.blogspot.com/_cfun81NILsU/SgE8Jb_FAII/AAAAAAAAABg/B51goKLDAds/S220/satish_thumb.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7690752520033688218.post-6364679797626993140</id><published>2007-07-03T16:18:00.000+05:30</published><updated>2007-07-03T16:35:11.909+05:30</updated><title type='text'>Varify Email address Format</title><content type='html'>Useful expressions for email address validation&lt;br /&gt;&lt;br /&gt;Matches a limited version of the RFC 2822 addr-spec form.&lt;br /&gt;&lt;br /&gt;/\A(?:[\w\!\#\$\%\&amp;\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&amp;amp;&lt;br /&gt;\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-]&lt;br /&gt;(?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}&lt;br /&gt;[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]&lt;br /&gt;?\d{1,2}|2[0-4]\d|25[0-5])\]))\Z/i&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7690752520033688218-6364679797626993140?l=satishchauhan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishchauhan.blogspot.com/feeds/6364679797626993140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7690752520033688218&amp;postID=6364679797626993140' title='32 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/6364679797626993140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/6364679797626993140'/><link rel='alternate' type='text/html' href='http://satishchauhan.blogspot.com/2007/07/varify-email-address-format.html' title='Varify Email address Format'/><author><name>Satish Chauhan</name><uri>http://www.blogger.com/profile/18110582246882842782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://2.bp.blogspot.com/_cfun81NILsU/SgE8Jb_FAII/AAAAAAAAABg/B51goKLDAds/S220/satish_thumb.jpg'/></author><thr:total>32</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7690752520033688218.post-8671783603487775655</id><published>2007-06-29T13:07:00.000+05:30</published><updated>2007-06-29T15:01:28.288+05:30</updated><title type='text'>Multiple Checkboxes with HABTM</title><content type='html'>Has and Belongs to Many with Multiple Check boxes&lt;br /&gt;&lt;br /&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’s the solution&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Model:&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;   class Customer &lt; ActiveRecord::Base&lt;br /&gt;     has_and_belongs_to_many :intrests&lt;br /&gt;   end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Controller code:&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    class CustomersController &lt; ApplicationController&lt;br /&gt;      def create&lt;br /&gt;        if request.post?&lt;br /&gt;           @customer=Customer.new(params[:customer])&lt;br /&gt;           @customer.save&lt;br /&gt;        end&lt;br /&gt;      end&lt;br /&gt;&lt;br /&gt;      def edit&lt;br /&gt;       @customer=Customer.find_by_id(params[:id]) if params[:id]&lt;br /&gt;       if @customer&lt;br /&gt;        if request.post?&lt;br /&gt;         if @customer.update_attributes(customer)&lt;br /&gt;           flash.now[:message]="Update successfully "&lt;br /&gt;         end&lt;br /&gt;        end&lt;br /&gt;       else&lt;br /&gt;        flash[:message]="Page requested by you does not exists"&lt;br /&gt;       end&lt;br /&gt;      end&lt;br /&gt;    end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Your View:&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;   &lt;% form_for :customer,  do |f| -%&gt;&lt;br /&gt;     First Name:&lt;br /&gt;      &lt;%= f.text_field :first_name  -%&gt;&lt;br /&gt;     Last Name:&lt;br /&gt;      &lt;%= f.text_field :last_name -%&gt;&lt;br /&gt;     &lt;% &lt;span style="font-weight:bold;"&gt;for&lt;/span&gt; intr in &lt;span style="font-weight:bold;"&gt;total_intrests&lt;/span&gt; -%&gt;&lt;br /&gt;      &lt;%= check_box_tag "customer[interest_ids][]","#{intr.id}",&lt;br /&gt;          interest(intr) -%&gt; # interest is a helper method  &lt;br /&gt;      &lt;%= "#{intr.name}" -%&gt;&lt;br /&gt;     &lt;% end -%&gt;&lt;br /&gt;   &lt;% end -%&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;helper method&lt;br /&gt;  def interest(i)&lt;br /&gt;    if @customer&lt;br /&gt;      @customer.interests.include?(i)&lt;br /&gt;    else&lt;br /&gt;      false&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7690752520033688218-8671783603487775655?l=satishchauhan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishchauhan.blogspot.com/feeds/8671783603487775655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7690752520033688218&amp;postID=8671783603487775655' title='47 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/8671783603487775655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/8671783603487775655'/><link rel='alternate' type='text/html' href='http://satishchauhan.blogspot.com/2007/06/multiple-checkboxes-with-habtm.html' title='Multiple Checkboxes with HABTM'/><author><name>Satish Chauhan</name><uri>http://www.blogger.com/profile/18110582246882842782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://2.bp.blogspot.com/_cfun81NILsU/SgE8Jb_FAII/AAAAAAAAABg/B51goKLDAds/S220/satish_thumb.jpg'/></author><thr:total>47</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7690752520033688218.post-7929589263773974866</id><published>2007-06-28T09:51:00.000+05:30</published><updated>2007-06-28T18:51:08.946+05:30</updated><title type='text'>How to generate CSV files in Rails</title><content type='html'>Your controller code :&lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;require&lt;/span&gt; 'csv'&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt; def export_to_csv&lt;/span&gt;&lt;br /&gt;   @customers=CustomerInformation.find(:all)&lt;br /&gt;   report = StringIO.new&lt;br /&gt;      CSV::Writer.generate(report, ',') &lt;span style="font-weight:bold;"&gt;do&lt;/span&gt; |title|&lt;br /&gt;        title &lt;&lt; ['Id','Job Title','First Name','Last Name']&lt;br /&gt;        @customers.each &lt;span style="font-weight:bold;"&gt;do&lt;/span&gt; |c|&lt;br /&gt;          title &lt;&lt; [c.id,c.job_title,c.first_name,c.last_name]&lt;br /&gt;        &lt;span style="font-weight:bold;"&gt;end&lt;br /&gt;      end&lt;/span&gt;&lt;br /&gt;     report.rewind&lt;br /&gt;     send_data(report.read,:type=&gt;'text/csv;charset=iso-8859-1;&lt;br /&gt;     header=present',:filename=&gt;'report.csv',&lt;br /&gt;     :disposition =&gt;'attachment', :encoding =&gt; 'utf8')&lt;br /&gt;  &lt;span style="font-weight:bold;"&gt;end&lt;/span&gt;&lt;br /&gt;Your view:&lt;br /&gt;&lt;br /&gt;      &lt;% form_tag({ :action =&gt;  :export_to_csv })do -%&gt; &lt;br /&gt;         &lt;%= submit_tag "Export To CSV" -%&gt;&lt;br /&gt;      &lt;% end -%&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://satishchauhan.wordpress.com"&gt;my another blog&lt;/a&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7690752520033688218-7929589263773974866?l=satishchauhan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishchauhan.blogspot.com/feeds/7929589263773974866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7690752520033688218&amp;postID=7929589263773974866' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/7929589263773974866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/7929589263773974866'/><link rel='alternate' type='text/html' href='http://satishchauhan.blogspot.com/2007/06/how-to-generate-csv-files-in-rails.html' title='How to generate CSV files in Rails'/><author><name>Satish Chauhan</name><uri>http://www.blogger.com/profile/18110582246882842782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://2.bp.blogspot.com/_cfun81NILsU/SgE8Jb_FAII/AAAAAAAAABg/B51goKLDAds/S220/satish_thumb.jpg'/></author><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7690752520033688218.post-345643624671308602</id><published>2007-06-22T11:48:00.000+05:30</published><updated>2007-06-22T12:41:40.768+05:30</updated><title type='text'>Active Scaffold</title><content type='html'>&lt;a href="http://activescaffold.com"&gt;Active scaffold&lt;/a&gt; is a plug in provide Ajax based user interface for a rails project. You can use it for Admin side activities&lt;br /&gt;&lt;br /&gt;    * An AJAXified interface for creating, updating and deleting objects&lt;br /&gt;    * Automatic handling of ActiveRecord associations&lt;br /&gt;    * Sorting and Searching&lt;br /&gt;    * CSS styling and theming support&lt;br /&gt;    * Work on Firefox 1+, IE 6+ and Safari 2+&lt;br /&gt;    * Released under the MIT License, the same one as Rails itself, so you can use it freely in your commercial applications.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Step-1:&lt;/span&gt;&lt;br /&gt;Install the plugin from the url:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;./script/plugin install http://activescaffold.googlecode.com/svn/tags/active_scaffold&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Step-2:&lt;/span&gt;&lt;br /&gt;Add to your layout&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;%= javascript_include_tag :defaults %&gt;&lt;br /&gt;&lt;%= active_scaffold_includes %&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Step-3:&lt;/span&gt; &lt;br /&gt;Add to your controller&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;active_scaffold :model_name&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Active scaffold requires a separate controller for a single model.If you do not want some attributes fields...&lt;br /&gt;Add to your Application controller&lt;br /&gt;&lt;br /&gt;  &lt;span style="font-weight:bold;"&gt;&lt;span style="font-weight:bold;"&gt; ActiveScaffold.set_defaults do |config| &lt;br /&gt;     config.ignore_columns.add [:created_at, :updated_at, :status]&lt;br /&gt;   end&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;or you can add to your controller for the attributes fields you want to to display &lt;br /&gt;&lt;br /&gt;   active_scaffold :TechniquesEmployed do |config|&lt;br /&gt;     config.label = "Techniques Employed"&lt;br /&gt;    &lt;span style="font-weight:bold;"&gt; config.columns = [:techniques_employed]&lt;/span&gt;&lt;br /&gt;     columns[:techniques_employed].label = "Technique Employed"&lt;br /&gt;   end&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7690752520033688218-345643624671308602?l=satishchauhan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishchauhan.blogspot.com/feeds/345643624671308602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7690752520033688218&amp;postID=345643624671308602' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/345643624671308602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/345643624671308602'/><link rel='alternate' type='text/html' href='http://satishchauhan.blogspot.com/2007/06/active-scaffold.html' title='Active Scaffold'/><author><name>Satish Chauhan</name><uri>http://www.blogger.com/profile/18110582246882842782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://2.bp.blogspot.com/_cfun81NILsU/SgE8Jb_FAII/AAAAAAAAABg/B51goKLDAds/S220/satish_thumb.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7690752520033688218.post-3595979325166667791</id><published>2007-06-13T23:15:00.000+05:30</published><updated>2007-06-22T10:56:15.565+05:30</updated><title type='text'>Let me Introduce My Self</title><content type='html'>Myself &lt;a href="http://satishchauhan.blogspot.com/"&gt;Satish Chauhan&lt;/a&gt; from Faridabad (haryana),  India.  I am a Electronics Engineer .&lt;br /&gt;I completed my engineering from &lt;a href="http://www.ymcaie.in/v1/default.aspx"&gt;YMCA Institute of Engineering&lt;/a&gt;, Faridabad (Harayana). Presently I am working  with &lt;a target="_blank" href="http://vinsol.com/"&gt;Vinayak Solutions Pvt. Ltd.(Vinsol)&lt;/a&gt;  as a Software Engineer .&lt;br /&gt;&lt;br /&gt;Vinsol is a software development(Web development) company based in New Delhi , India. It works on &lt;a href="http://rubyonrails.org/"&gt;ruby on rails&lt;/a&gt;.&lt;br /&gt;I am enjoying Ruby and Ruby On Rails&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7690752520033688218-3595979325166667791?l=satishchauhan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://satishchauhan.blogspot.com/feeds/3595979325166667791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7690752520033688218&amp;postID=3595979325166667791' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/3595979325166667791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7690752520033688218/posts/default/3595979325166667791'/><link rel='alternate' type='text/html' href='http://satishchauhan.blogspot.com/2007/06/myself-satish-chauhan-from.html' title='Let me Introduce My Self'/><author><name>Satish Chauhan</name><uri>http://www.blogger.com/profile/18110582246882842782</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://2.bp.blogspot.com/_cfun81NILsU/SgE8Jb_FAII/AAAAAAAAABg/B51goKLDAds/S220/satish_thumb.jpg'/></author><thr:total>0</thr:total></entry></feed>
