<?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-5928797381335814714</id><updated>2011-11-27T16:15:54.580-08:00</updated><title type='text'>Class RailsThinker &lt; Rails</title><subtitle type='html'>Single Table inheritance from Rails Core.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5928797381335814714.post-7132232359844373357</id><published>2009-11-16T15:27:00.000-08:00</published><updated>2009-11-16T15:35:46.758-08:00</updated><title type='text'>Rails and Amazon Web Services</title><content type='html'>Hi all,&lt;br /&gt;&lt;br /&gt;One of the Most wanted skills in Ruby on Rails right now is "Rails and Amazon: Libraries and Plugins for EC2, S3, SimpleDB, SQS, FPS and DevPay Integration". The below link will much useful those who are looking to learn about these integartions.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bit.ly/yQsuS"&gt;http://bit.ly/yQsuS&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Rails become like a ocean now itself, just think after the official release of "Rails 3". That should be a cyclone on web development industries.&lt;br /&gt;&lt;br /&gt;Think more about "Rails", do more development :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5928797381335814714-7132232359844373357?l=railsthinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/7132232359844373357/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5928797381335814714&amp;postID=7132232359844373357' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/7132232359844373357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/7132232359844373357'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/2009/11/rails-and-amazon-web-services.html' title='Rails and Amazon Web Services'/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5928797381335814714.post-6578046626527949964</id><published>2009-10-21T19:47:00.001-07:00</published><updated>2009-10-21T19:47:29.243-07:00</updated><title type='text'>Simple Array Comparison in Ruby</title><content type='html'>Here is a simple method to compare two arrays using Ruby, few examples:&lt;br /&gt;&lt;br /&gt;&gt; [1,2,3] &lt;=&gt; [1,2,3]&lt;br /&gt;=&gt; 0&lt;br /&gt;&gt; [1,2,3] &lt;=&gt; [2,2,3]&lt;br /&gt;=&gt; -1&lt;br /&gt;&gt; [1,2,3] &lt;=&gt; [3,2,3]&lt;br /&gt;=&gt; -1&lt;br /&gt;&gt; [1,2,3] &lt;=&gt; [1,3,3]&lt;br /&gt;=&gt; -1&lt;br /&gt;&gt; [1,2,3] &lt;=&gt; [1,1,3]&lt;br /&gt;=&gt; 1&lt;br /&gt;&lt;br /&gt;By use of Terinary Operator (&lt;=&gt;), we can acheive the simple method to compare two arrays of comparison.&lt;br /&gt;&lt;br /&gt;Hope this will help for someone or me in future!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5928797381335814714-6578046626527949964?l=railsthinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/6578046626527949964/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5928797381335814714&amp;postID=6578046626527949964' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/6578046626527949964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/6578046626527949964'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/2009/10/simple-array-comparison-in-ruby.html' title='Simple Array Comparison in Ruby'/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5928797381335814714.post-4784428281181268720</id><published>2009-07-03T02:38:00.000-07:00</published><updated>2009-07-03T03:11:26.373-07:00</updated><title type='text'>Get Start/Switch your projects with Ruby On Rails</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_02M0qGMwH0c/Sk3ZBU9u9tI/AAAAAAAAABU/KOGbPFTTq6U/s1600-h/ruby-on-rails.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand; height: 150px;" src="http://3.bp.blogspot.com/_02M0qGMwH0c/Sk3ZBU9u9tI/AAAAAAAAABU/KOGbPFTTq6U/s400/ruby-on-rails.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5354174148844123858" /&gt;&lt;/a&gt;&lt;br /&gt;For this past few years i missed to read an wonderful article about the succession of Ruby on Rails. This article explains us &lt;strong&gt;"How Ruby on Rails succeeded and intention to Create this?"&lt;/strong&gt; Dont ever miss any one to read this article. Just click the below link and start to work with Ruby on Rails.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://tinyurl.com/kopbwe"&gt;http://tinyurl.com/kopbwe&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;For each and every programmers or technicians or business development managers, this article should read and need to get know about Ruby On Rails(ROR). &lt;br /&gt;&lt;br /&gt;Especially in India, so much of them didnt even know about this framework and language. Some bigger companies are not yet started to accomodate this simple framework( rails ) with the base powerful language (ruby). They should come over and start to work on this technology. Its the only language now the direct competitor for Java in the whole world. In Denmark, it almost 90% of programmers using this framework.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It Benefits a lot. In Brief, &lt;br /&gt;&lt;br /&gt;-&gt; Reduce the number of hours to develop a application.&lt;br /&gt;-&gt; Reduce the number of developers involved to create a application.&lt;br /&gt;-&gt; Reduce the stress, energy to create the applications by the developers. &lt;br /&gt;-&gt; Easy to learn the framework.&lt;br /&gt;-&gt; More compatible with all platforms.&lt;br /&gt;-&gt; Easy to implement the Agile methods.&lt;br /&gt;&lt;br /&gt;Finally, Last but not Least, its everthing "OPEN SOURCE". Get think over the above advantages and start / switch your projects with Ruby On Rails.&lt;br /&gt;&lt;br /&gt;Happy coding and will see you in another information.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5928797381335814714-4784428281181268720?l=railsthinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/4784428281181268720/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5928797381335814714&amp;postID=4784428281181268720' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/4784428281181268720'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/4784428281181268720'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/2009/07/get-startswitch-your-projects-with-ruby.html' title='Get Start/Switch your projects with Ruby On Rails'/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_02M0qGMwH0c/Sk3ZBU9u9tI/AAAAAAAAABU/KOGbPFTTq6U/s72-c/ruby-on-rails.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5928797381335814714.post-4672851226097973694</id><published>2009-06-13T08:14:00.000-07:00</published><updated>2009-06-13T10:02:38.462-07:00</updated><title type='text'>Searching String(s) in file(s) using Ruby</title><content type='html'>Searching String(s) in file(s) using Ruby is very simiple. Here is the sample code to manipulate it. &lt;br /&gt;&lt;br /&gt;# searching a string in a file&lt;br /&gt;def print_line_containing(file, str)&lt;br /&gt;  File.open(file).grep(/#{str}/).each do |line| puts "#{line}" end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;# searching multiple strings in a file&lt;br /&gt;def print_line_containing(file, str1, str2)&lt;br /&gt;  File.open(file).grep(/#{str1}\s+#{str2}/).each do |line| puts "#{line}" end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# searching multiple strings in multiple files&lt;br /&gt;def print_line_containing(file_array, str)&lt;br /&gt;    file_array.each do |file|&lt;br /&gt;      File.open(file).grep(/#{str1}\s+#{str2}/).each do |line| puts "#{line}" end&lt;br /&gt;    end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;I hope this will help you all!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5928797381335814714-4672851226097973694?l=railsthinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/4672851226097973694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5928797381335814714&amp;postID=4672851226097973694' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/4672851226097973694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/4672851226097973694'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/2009/06/searching-strings-in-files-using-ruby.html' title='Searching String(s) in file(s) using Ruby'/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5928797381335814714.post-1901089748761886365</id><published>2009-06-10T08:29:00.000-07:00</published><updated>2009-06-10T08:38:20.887-07:00</updated><title type='text'>Building Shopping Cart with Ruby on Rails in few minutes</title><content type='html'>we can easily build a shopping cart application in a fraction of few minutes.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://code.google.com/p/substruct/" target="_blank"&gt;http://code.google.com/p/substruct/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Use the above link and download the substruct application. Follow the instructions  like installation, svn updating the substruct engine, and etc., from the left nav bar on that page.&lt;br /&gt;&lt;br /&gt;Then you will get the shopping cart application with payment integration with the Active Merchant plugin.&lt;br /&gt;&lt;br /&gt;Get use of open source and explore your thoughts with your application.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5928797381335814714-1901089748761886365?l=railsthinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/1901089748761886365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5928797381335814714&amp;postID=1901089748761886365' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/1901089748761886365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/1901089748761886365'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/2009/06/building-shopping-cart-in-few-minutes.html' title='Building Shopping Cart with Ruby on Rails in few minutes'/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5928797381335814714.post-6304925141168347460</id><published>2009-05-22T10:48:00.000-07:00</published><updated>2009-05-22T12:01:20.146-07:00</updated><title type='text'>Array Mapping in Ruby</title><content type='html'>Hi to All,&lt;br /&gt;&lt;br /&gt;Here is the sample code to know the usage of array mapping in Ruby.&lt;br /&gt;&lt;br /&gt;&gt;&gt; User.find_all_by_office_id(20)&lt;br /&gt;=&gt; [#&lt;User id: 1032, name: "cindy"&gt;, #&lt;User id: 3646, name: "saxtonsrealestate.com"&gt;]&lt;br /&gt;&lt;br /&gt;If you want to map only the User id's from the above result set. then you should use like this:&lt;br /&gt;&lt;br /&gt;&gt;&gt; User.find_all_by_office_id(20).map(&amp;:id)&lt;br /&gt;=&gt; [1032, 3646]&lt;br /&gt;&lt;br /&gt;If you want to use these User id's in an another query with "IN" predicate. Then you should use like this:&lt;br /&gt;&lt;br /&gt;&gt;&gt; User.find_all_by_office_id(20).map(&amp;:id).compact.join(",")&lt;br /&gt;=&gt; "1032,3646"&lt;br /&gt;&lt;br /&gt;the &lt;span style="font-weight:bold;"&gt;compact&lt;/span&gt; will you delete the blank array element from the result set.&lt;br /&gt;&lt;br /&gt;then it joins with "," (comma). So finally you will get the string with concatenated id's with comma. You can use this string in the another query with "IN" predicate, like this&lt;br /&gt;&lt;br /&gt;&gt;&gt;user_ids = User.find_all_by_office_id(20).map(&amp;:id).compact.join(",")&lt;br /&gt;&lt;br /&gt;&gt;&gt;y Website.find(:all, :conditions =&gt; "user_id in(#{user_ids})")&lt;br /&gt;&lt;br /&gt;you will the websites list for these users.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5928797381335814714-6304925141168347460?l=railsthinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/6304925141168347460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5928797381335814714&amp;postID=6304925141168347460' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/6304925141168347460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/6304925141168347460'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/2009/05/array-mapping-in-ruby.html' title='Array Mapping in Ruby'/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5928797381335814714.post-1582330062709524904</id><published>2009-04-17T09:04:00.001-07:00</published><updated>2009-05-22T08:14:02.220-07:00</updated><title type='text'>Rails 2.3.2 bugs with solutions</title><content type='html'>For the rails thinkers this link may helpful a lot to solve their basic issues with recent rails released version 2.3.2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://tiny.cc/67kLX" target="_blank"&gt;http://tiny.cc/67kLX&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5928797381335814714-1582330062709524904?l=railsthinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/1582330062709524904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5928797381335814714&amp;postID=1582330062709524904' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/1582330062709524904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/1582330062709524904'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/2009/04/rails-232-bugs-with-solutions.html' title='Rails 2.3.2 bugs with solutions'/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5928797381335814714.post-7280745161746305256</id><published>2009-04-17T01:55:00.000-07:00</published><updated>2009-04-17T02:22:57.728-07:00</updated><title type='text'>Gem Capistrano issue on Ruby on Rails</title><content type='html'>If you are going to use capistrano gem for deployment.&lt;br /&gt;&lt;br /&gt;you should install two gems for this:&lt;br /&gt;&lt;br /&gt;sudo gem install capistrano&lt;br /&gt;sudo gem install capistrano-ext&lt;br /&gt;&lt;br /&gt;If you missed out "&lt;span style="font-weight: bold;"&gt;capistrano-ext&lt;/span&gt;" gem to install,&lt;br /&gt;&lt;br /&gt;it wont you to execute capistrano operations like deploy, log, etc., i.e tasks which are using your deploy.rb&lt;br /&gt;&lt;br /&gt;/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- capistrano/ext/multistage (LoadError)&lt;br /&gt;&lt;br /&gt;and it returns the above error.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5928797381335814714-7280745161746305256?l=railsthinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/7280745161746305256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5928797381335814714&amp;postID=7280745161746305256' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/7280745161746305256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/7280745161746305256'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/2009/04/gem-capistrano-issue-on-ruby-on-rails.html' title='Gem Capistrano issue on Ruby on Rails'/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5928797381335814714.post-5191244835814834026</id><published>2009-04-15T08:00:00.000-07:00</published><updated>2009-04-15T11:34:06.350-07:00</updated><title type='text'>Rmagick and ImageMagick Installation steps in Ubuntu</title><content type='html'>Hi to all,&lt;br /&gt;&lt;br /&gt;After 1 to 2 hours struggling with the Rmagick and ImageMagick Installation in Ubuntu 8.10, i have found a simpler steps to do:&lt;br /&gt;&lt;br /&gt;1) Install "imagemagick" through apt-get or synaptic manager.&lt;br /&gt;2) Again Install&lt;span&gt; "libmagick9-dev&lt;/span&gt;" through apt-get or synaptic manager.&lt;br /&gt;3) Then, sudo gem install rmagick ( recent version will get install )&lt;br /&gt;&lt;br /&gt;If you want a specific version of rmagick, then use this&lt;br /&gt;sudo gem install rmagick -v 1.15.12&lt;br /&gt;&lt;br /&gt;Note:  rmagick 1.15.12 version is a stable gem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5928797381335814714-5191244835814834026?l=railsthinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/5191244835814834026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5928797381335814714&amp;postID=5191244835814834026' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/5191244835814834026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/5191244835814834026'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/2009/04/rmagick-and-imagemagick-installation.html' title='Rmagick and ImageMagick Installation steps in Ubuntu'/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5928797381335814714.post-6492579825005935288</id><published>2009-04-14T09:05:00.000-07:00</published><updated>2009-04-15T11:34:49.243-07:00</updated><title type='text'>To install rubygems in Ubuntu</title><content type='html'>I prefer these commands to install updated RubyGems in Ubuntu. Use the below commands on your terminal and get it quicker.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;sudo gem install rubygems-update&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;sudo update_rubygems&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5928797381335814714-6492579825005935288?l=railsthinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/6492579825005935288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5928797381335814714&amp;postID=6492579825005935288' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/6492579825005935288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/6492579825005935288'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/2009/04/to-nstall-rubygems-in-ubuntu.html' title='To install rubygems in Ubuntu'/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5928797381335814714.post-443600729231491353</id><published>2009-03-26T09:35:00.000-07:00</published><updated>2009-03-26T10:00:23.323-07:00</updated><title type='text'>Rails on Git</title><content type='html'>Git is one of the extreme repository storage media. Its similar kind of Subversion(SVN), CVS, Mercurial, etc revisioning system. Its pretty much useful for rails kind of frameworks. Even our Rails gem also switched to Git repository from SVN.&lt;br /&gt;&lt;br /&gt;I feel more happy to work with it. &lt;span style="font-weight: bold;"&gt;Its fast and furious&lt;/span&gt;. i'll suggest you to adopt into this technology.&lt;br /&gt;&lt;br /&gt;Today i have found one superb tool to find the difference and merging the conflicted file by comparing between the local and remote files with Good GUI.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.kernel.org/pub/software/scm/git/docs/git-mergetool.html"&gt;man page&lt;/a&gt; for git mergetool&lt;br /&gt;&lt;br /&gt;meld is one of the tool to find the difference between multiple files. Use the below command to run the tool.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;git mergetool -tool=meld&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Sample Dispaly for this tool:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_02M0qGMwH0c/ScuzbUEAmQI/AAAAAAAAAAg/sUSm4KQ3sp8/s1600-h/git_merge_tool.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 267px;" src="http://3.bp.blogspot.com/_02M0qGMwH0c/ScuzbUEAmQI/AAAAAAAAAAg/sUSm4KQ3sp8/s400/git_merge_tool.png" alt="" id="BLOGGER_PHOTO_ID_5317541066864367874" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I will update about GIT regularly on either &lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;a style="font-weight: bold;" href="http://gokulamurthy.blogspot.com/"&gt;gokulamurthy.blogspot.com&lt;/a&gt; or on this.&lt;br /&gt;Keep Updating your knowledge.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5928797381335814714-443600729231491353?l=railsthinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/443600729231491353/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5928797381335814714&amp;postID=443600729231491353' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/443600729231491353'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/443600729231491353'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/2009/03/rails-on-git.html' title='Rails on Git'/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_02M0qGMwH0c/ScuzbUEAmQI/AAAAAAAAAAg/sUSm4KQ3sp8/s72-c/git_merge_tool.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5928797381335814714.post-1066645105484788938</id><published>2009-03-23T08:40:00.000-07:00</published><updated>2009-03-23T08:50:33.803-07:00</updated><title type='text'>Rails 2.3 Features or Enhancements</title><content type='html'>Hi Friends,&lt;br /&gt;&lt;br /&gt;Rails 2.3 is successfully launched and excited to work with it. Here is the brief features list:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://ryandaigle.com/articles/2009/2/23/what-s-new-in-edge-rails-batched-find" target="_blank"&gt;Batched find&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://ryandaigle.com/articles/2009/2/1/what-s-new-in-edge-rails-nested-attributes" target="_blank"&gt;Nested Model Mass Assignment&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://ryandaigle.com/articles/2009/1/30/what-s-new-in-edge-rails-http-digest-authentication" target="_blank"&gt;&lt;span class="caps" target="_blank"&gt;HTTP&lt;/span&gt; Digest Authentication&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://ryandaigle.com/articles/2008/12/29/what-s-new-in-edge-rails-dynamic-scope-methods" target="_blank"&gt;Dynamic Scopes&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://ryandaigle.com/articles/2008/12/11/what-s-new-in-edge-rails-application-generators" title="templates" target="_blank"&gt;Application Generators&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://ryandaigle.com/articles/2008/12/18/what-s-new-in-edge-rails-rails-metal" target="_blank"&gt;Rails Metal&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://ryandaigle.com/articles/2008/11/27/what-s-new-in-edge-rails-no-more-formatted-routes" target="_blank"&gt;No More Formatted Routes&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://ryandaigle.com/articles/2008/11/20/what-s-new-in-edge-rails-object-try" target="_blank"&gt;Object.try&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://ryandaigle.com/articles/2008/11/20/what-s-new-in-edge-rails-render-stops-being-high-maintenance" target="_blank"&gt;Simplified render&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://ryandaigle.com/articles/2008/11/19/what-s-new-in-edge-rails-application-rb-duality-is-no-more" target="_blank"&gt;application.rb Becomes application_controller.rb&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://ryandaigle.com/articles/2008/11/18/what-s-new-in-edge-rails-default-scoping" target="_blank"&gt;Default Scoping&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;From the below &lt;a href="http://guides.rubyonrails.org/2_3_release_notes.html" target="_blank"&gt;rails 2.3 release notes&lt;/a&gt; link you may get the summary of each above features.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://guides.rubyonrails.org/2_3_release_notes.html" target="_blank"&gt;http://guides.rubyonrails.org/2_3_release_notes.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Enjoy Coding with Rails!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5928797381335814714-1066645105484788938?l=railsthinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/1066645105484788938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5928797381335814714&amp;postID=1066645105484788938' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/1066645105484788938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/1066645105484788938'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/2009/03/rails-23-features-or-enhancements.html' title='Rails 2.3 Features or Enhancements'/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5928797381335814714.post-3079283266795307957</id><published>2009-03-20T07:42:00.000-07:00</published><updated>2009-03-20T07:54:17.681-07:00</updated><title type='text'>map method is one of the best methods in rails</title><content type='html'>This methods will turns the symbol to proc.&lt;br /&gt;&lt;br /&gt;Here is an example:&lt;br /&gt;&lt;br /&gt;&gt;&gt; tcs = TemplateCompatibility.find :all, :select =&gt; "DISTINCT id, template_id"&lt;br /&gt;=&gt; [#&lt;templatecompatibility:0xb70b4cf0 attributes="{"&gt;"1", "id"=&gt;"1"}&gt;, #&lt;templatecompatibility:0xb70b4cb4 attributes="{"&gt;"2", "id"=&gt;"2"}&gt;, #&lt;templatecompatibility:0xb70b4b9c attributes="{"&gt;"3", "id"=&gt;"3"}&gt;, #&lt;templatecompatibility:0xb70b4b38 attributes="{"&gt;"4", "id"=&gt;"4"}&gt;, #&lt;templatecompatibility:0xb70b4afc attributes="{"&gt;"5", "id"=&gt;"5"}&gt;, #&lt;templatecompatibility:0xb70b4ac0 attributes="{"&gt;"6", "id"=&gt;"6"}&gt;, #&lt;templatecompatibility:0xb70b49f8 attributes="{"&gt;"7", "id"=&gt;"7"}&gt;, #&lt;templatecompatibility:0xb70b49d0 attributes="{"&gt;"4", "id"=&gt;"8"}&gt;]&lt;br /&gt;&lt;br /&gt;If you want to extract a specific field from the above result set or an array, here in the above example i want to extract specifically &lt;span style="font-weight: bold;"&gt;template_id&lt;/span&gt; values, then we can use &lt;span style="font-weight: bold;"&gt;"map"&lt;/span&gt; method to get the values in a new array. Here is the syntax to use it with this example.&lt;br /&gt;&lt;br /&gt;&gt;&gt; tcs.map(&amp;amp;:template_id)&lt;br /&gt;=&gt; [1, 2, 3, 4, 5, 6, 7, 4]&lt;br /&gt;&lt;br /&gt;Enjoy Coding &amp;amp; hacking too!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5928797381335814714-3079283266795307957?l=railsthinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/3079283266795307957/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5928797381335814714&amp;postID=3079283266795307957' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/3079283266795307957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/3079283266795307957'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/2009/03/map-method-is-one-of-best-methods-in.html' title='map method is one of the best methods in rails'/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5928797381335814714.post-7072730176015601963</id><published>2009-03-19T22:24:00.000-07:00</published><updated>2009-03-19T22:26:13.426-07:00</updated><title type='text'>Difference Between rspec and rspec-rails gems/plugins</title><content type='html'>&lt;pre&gt;&lt;span style="font-weight: bold;"&gt;rspec gem or plugin&lt;/span&gt; =&gt; basic rspec without rails support (runner, rake&lt;br /&gt;task, api for describe/it, should etc)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;rspec-rails gem or plugin&lt;/span&gt; =&gt; extra support for rails model view and&lt;br /&gt;controller, database integration, code generation (script/generate)&lt;br /&gt;&lt;br /&gt;It doesn't matter whether you use the gem or the plugin. Just pick one&lt;br /&gt;that suits your project.&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/5928797381335814714-7072730176015601963?l=railsthinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/7072730176015601963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5928797381335814714&amp;postID=7072730176015601963' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/7072730176015601963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/7072730176015601963'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/2009/03/difference-between-rspec-and-rspec.html' title='Difference Between rspec and rspec-rails gems/plugins'/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5928797381335814714.post-5482337466406970366</id><published>2009-03-17T08:35:00.000-07:00</published><updated>2009-03-17T08:50:24.240-07:00</updated><title type='text'>Free E-Magzines for Rails</title><content type='html'>"&lt;a href="http://therubyist.com/"&gt;The Rubyist&lt;/a&gt;" and "&lt;a href="http://railsmagazine.com/"&gt;Rails Magazine&lt;/a&gt;" are the magazines has announced to download their issues as E-book/E-Magazine per month.  You can download their issues from their official websites itself. That is,&lt;br /&gt;&lt;br /&gt;&lt;a href="http://therubyist.com/"&gt;http://therubyist.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://railsmagazine.com/"&gt;http://railsmagazine.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Download and Enjoy :)&lt;br /&gt;&lt;br /&gt;Keep on improve your skills  and knowledge in Ruby On Rails.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5928797381335814714-5482337466406970366?l=railsthinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/5482337466406970366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5928797381335814714&amp;postID=5482337466406970366' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/5482337466406970366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/5482337466406970366'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/2009/03/free-e-magzines-for-rails.html' title='Free E-Magzines for Rails'/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5928797381335814714.post-4249605833271519685</id><published>2009-02-16T02:35:00.000-08:00</published><updated>2009-02-16T02:41:19.741-08:00</updated><title type='text'>creating a directory using ruby</title><content type='html'>&lt;p&gt; Creates a directory and all its parent directories. For example, &lt;/p&gt;   &lt;span style="font-weight: bold;"&gt;FileUtils.mkdir_p '/usr/local/lib/ruby' &lt;/span&gt; &lt;p&gt; causes to make following directories, if it does not exist. &lt;/p&gt; &lt;span style="font-weight: bold;"&gt;    * /usr&lt;br /&gt;* /usr/local    &lt;br /&gt;* /usr/local/lib    &lt;br /&gt;* /usr/local/lib/ruby&lt;/span&gt;  &lt;p&gt; You can pass several directories at a time in a list. &lt;/p&gt;&lt;pre&gt;&lt;br /&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/5928797381335814714-4249605833271519685?l=railsthinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/4249605833271519685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5928797381335814714&amp;postID=4249605833271519685' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/4249605833271519685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/4249605833271519685'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/2009/02/creating-directory-using-ruby.html' title='creating a directory using ruby'/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5928797381335814714.post-6106100136742208518</id><published>2009-02-04T06:28:00.000-08:00</published><updated>2009-02-04T06:39:48.432-08:00</updated><title type='text'></title><content type='html'>&lt;span style="font-weight: bold;"&gt;submit_tag&lt;/span&gt; will be override the functionality &lt;span style="font-weight: bold;"&gt;reset&lt;/span&gt; in Rails.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Eg: Reset tag in Rails&lt;/span&gt;&lt;br /&gt;&lt;%= submit_tag "Reset", :name =&gt; 'reset', :type =&gt; 'reset', :id =&gt; 'task_reset' %&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5928797381335814714-6106100136742208518?l=railsthinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/6106100136742208518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5928797381335814714&amp;postID=6106100136742208518' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/6106100136742208518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/6106100136742208518'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/2009/02/submittag-will-be-override.html' title=''/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5928797381335814714.post-4227092945115106425</id><published>2007-11-22T22:53:00.000-08:00</published><updated>2007-11-22T23:13:24.965-08:00</updated><title type='text'>Documentation with RDoc</title><content type='html'>&lt;h3&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;Generating documentation with RDoc &lt;/span&gt;&lt;br /&gt;&lt;/h3&gt; &lt;p&gt;We’ll suppose that your application is a Rails application. &lt;/p&gt; &lt;ol&gt;&lt;li&gt;Go to the root of your application&lt;/li&gt;&lt;li&gt;Type &lt;em&gt;rake doc:app&lt;/em&gt;&lt;/li&gt;&lt;/ol&gt; This rake task (that uses RDoc) will start generating the documentation for your application. It will detect every controllers, every models, every helpers, every methods, every attributes, every constants, every whatever and will structure all of this in a logical manner. Then, it will output a bunch of HTML files that you will find in &lt;em&gt;doc/app&lt;/em&gt;. Moreover, it will detect every comments you wrote and try to include them at the right place in the doc.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;Syntaxes and Examples to do comments on your applications :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);font-size:100%;" &gt;Text Decoration :&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;                &lt;div class="method-description"&gt;           &lt;h2&gt;This method is a very critical one in our system. Please be careful!&lt;/h2&gt; &lt;p&gt; The text above is bigger because I used 2 heading characters "==" before typing the actual comment. (It‘s like the h1, h2, h3 tags in HTML but instead you use =, ==, === and so on) &lt;/p&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;Ordering:&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;It takes 2 params  &lt;/li&gt;&lt;li&gt;We discard the 1st one  &lt;/li&gt;&lt;li&gt;We put "mister t" in the second one if nothing has been supplied.  &lt;/li&gt;&lt;/ol&gt;  As you can see, you can also create ordered lists with RDoc. Just type a digit and then a period before your comment. If you need a non-ordered list, type * or - before your comment. If you need an alpha list, type a letter followed by a period. Note also that RDoc automatically put hyperlinks around method and class names. That‘s a very easy and useful way to help people navigating in your documentation! Hey let‘s try it…&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;Hyperlink :&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;RDoc also detects external links, like &lt;a href="http://www.railsthinker.blogspot.com/"&gt;www.railsthinker.blogspot.com&lt;/a&gt;. If you prefer displaying a label instead of an URL address, use the label[url] format instead, like that : &lt;a href="http://www.rubyfleebie.com/"&gt;www.railsthinker.blogspot.com&lt;/a&gt;. If your label as more than 2 words (like in the example), put them inside curly braces, like that {Rock on!} [the url]&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);font-size:100%;" &gt;&lt;b style="font-weight: bold;"&gt;HTML&lt;/b&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;em style="font-weight: bold;"&gt;basic&lt;/em&gt;&lt;span style="font-weight: bold;"&gt; formatting &lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);font-size:100%;" &gt;:&lt;/span&gt;&lt;br /&gt;      &lt;/div&gt;&lt;p&gt; Finally, how about some &lt;b&gt;HTML&lt;/b&gt; &lt;em&gt;basic&lt;/em&gt; formatting? if it is just one word long, use * hello * for bold and _ hello _ for italic (just remove the spaces). Now if the thing to format is more than one word long, use the more traditionnal &lt;em&gt; and &lt;/em&gt;&amp;amp;&lt;span class="entity"&gt;lt;&lt;/span&gt;em&amp;amp;&lt;span class="entity"&gt;gt;&lt;/span&gt; and &amp;amp;&lt;span class="entity"&gt;lt;&lt;/span&gt;b&amp;amp;&lt;span class="entity"&gt;gt; &lt;/span&gt;tags (just a nitpicky question though : Why "b" instead of "strong"?).&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;em&gt;&lt;b&gt;&lt;span style="color: rgb(0, 102, 0); font-weight: bold;font-size:130%;" &gt;One final note : &lt;/span&gt;&lt;strong&gt;&lt;br /&gt;&lt;br /&gt;RDoc is not specific to Rails&lt;/strong&gt;. Like I said earlier, it is a ruby library and thus you can use it in other contexts. I took Rails because I knew that the % of people using Ruby without Rails was rather small.&lt;br /&gt;&lt;/b&gt;&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5928797381335814714-4227092945115106425?l=railsthinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/4227092945115106425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5928797381335814714&amp;postID=4227092945115106425' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/4227092945115106425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/4227092945115106425'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/2007/11/generating-documentation-with-rdoc.html' title='Documentation with RDoc'/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5928797381335814714.post-88519153650118672</id><published>2007-10-01T19:53:00.000-07:00</published><updated>2007-10-05T07:03:47.500-07:00</updated><title type='text'>Filters in RoR</title><content type='html'>Hi to all,&lt;br /&gt;&lt;br /&gt;  Filters enable you to write code in your controllers that wrap the processing&lt;br /&gt;performed by actions—you can write a chunk of code once and have it be&lt;br /&gt;called before or after any number of actions in your controller (or your controller’s&lt;br /&gt;subclasses). This turns out to be a powerful facility. Using filters, we&lt;br /&gt;can implement authentication schemes, logging, response compression, and&lt;br /&gt;even response customization.&lt;br /&gt;&lt;br /&gt;Rails supports three types of filter: &lt;span style="font-weight: bold;"&gt;before, after, and around&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;before and after filters are invoked before or after&lt;br /&gt;an action. Rails maintains two chains of filters for each controller. When a&lt;br /&gt;controller is about to run an action, it executes all the filters on the before&lt;br /&gt;chain. It executes the action before running the filters on the after chain.&lt;br /&gt;&lt;br /&gt;eg: if u want to do the authentication for few files in ur app. Use this following code&lt;br /&gt;&lt;br /&gt;put this code in ur applicaion.rb file of ur respective controller:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;def authorize&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;unless User.find_by_id(session[:user_id])&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;flash[:notice] = "Please log in"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;redirect_to(:controller =&gt; "login" , :action =&gt; "login" )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;end&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;put the below in ur controller file. eg: name_controller.rb&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;class AdminController &lt;&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;using this filter u can protect each and every methods under this controller.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;After Filter:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;U can call this method after u executed any methods ( in ur controller ) like the below code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;class AdminController &lt;&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;before_filter :authorize&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;# ....&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Around Filters&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;Around filters wrap the execution of actions. You can write an around filter in&lt;br /&gt;two different styles. In the first, the filter is a single chunk of code. That code&lt;br /&gt;is called before the action is executed. If the filter code invokes yield, the action&lt;br /&gt;is executed. When the action completes, the filter code continues executing.&lt;br /&gt;Thus, the code before the yield is like a before filter, and the code after the&lt;br /&gt;yield is the after filter. If the filter code never invokes yield, the action is not&lt;br /&gt;run—this is the same as having a before filter return false.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Example :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;around_filter :one, :two&lt;br /&gt;def one&lt;br /&gt;logger.info("start one" )&lt;br /&gt;yield&lt;br /&gt;logger.info("end one" )&lt;br /&gt;end&lt;br /&gt;def two&lt;br /&gt;logger.info("start two" )&lt;br /&gt;yield&lt;br /&gt;logger.info("end two" )&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;the sequence of log messages will be&lt;br /&gt;start one&lt;br /&gt;start two&lt;br /&gt;. . .&lt;br /&gt;end two&lt;br /&gt;end one&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5928797381335814714-88519153650118672?l=railsthinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/88519153650118672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5928797381335814714&amp;postID=88519153650118672' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/88519153650118672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/88519153650118672'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/2007/10/filters-in-ror.html' title='Filters in RoR'/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5928797381335814714.post-986467839573917020</id><published>2007-08-25T06:24:00.000-07:00</published><updated>2007-09-08T02:55:26.614-07:00</updated><title type='text'>Simple AJAX concept : observe_field</title><content type='html'>&lt;span style="color: rgb(0, 0, 0);font-family:georgia;" &gt;Hi to all,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;There are lot of ways to do AJAX in ruby on rails. This is one of the easiest way i found. Use the observe_field method.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0); font-weight: bold; font-style: italic;"&gt;Syntax:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:georgia;" &gt;&lt;span style="color: rgb(0, 0, 0); font-weight: bold;font-size:130%;" &gt;observe_field(field_id, options = {})&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0); font-style: italic;font-family:georgia;" &gt;Sample Code:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;In the view u need to put this code:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;font-family:georgia;" &gt;Search By:&lt;br /&gt;&lt;br /&gt;&lt;%= select("listing", "search_by", [["City","1"],["Zip Code","2"],["State","3"]]) %&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;font-family:georgia;" &gt;&lt;%=observe_field("listing_search_by", :url=&gt;{:controller=&gt;"search",:action=&gt;"updatefields"},&lt;br /&gt;:update=&gt;"updatefields",&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;" class="sy"&gt; :frequency&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;"&gt; =&gt; &lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;" class="i"&gt;0.5&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;font-family:georgia;" &gt;)%&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;"&gt; &amp;lt;label id="updatefields"&amp;gt;Enter the City&amp;lt;/label&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;"&gt;&lt;%= text_field_tag :query%&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note: frequency determines the speed ( in seconds ) if it less than zero its event time observer.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0); font-style: italic;font-family:georgia;" &gt;Controller code:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;font-family:georgia;" &gt;def updatefields&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;font-family:georgia;" &gt;@rvalue=request.raw_post&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;font-family:georgia;" &gt;if @rvalue == "1"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;font-family:georgia;" &gt;@value="Enter the City"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;font-family:georgia;" &gt;elsif @rvalue == "2"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;font-family:georgia;" &gt;@value="Enter the Zip Code"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;font-family:georgia;" &gt;else @rvalue == "3"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;font-family:georgia;" &gt;@value="Enter the State"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;font-family:georgia;" &gt;end&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;font-family:georgia;" &gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;The above sample code is used to display the label. Dynamically search text field's label is going to change... we can manipulate with the data avail in the database also(without reloading the window or browser. ie AJAX). This is easy to learn and simple to use and effective in the output.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;Use and Enjoy.....&lt;br /&gt;&lt;br /&gt;(If i made any mistake or u need any more clarification on this prompt me at &lt;span style="font-weight: bold;"&gt;gokulamurthy@gmail.com&lt;/span&gt;)&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5928797381335814714-986467839573917020?l=railsthinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://railsthinker.blogspot.com/feeds/986467839573917020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5928797381335814714&amp;postID=986467839573917020' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/986467839573917020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5928797381335814714/posts/default/986467839573917020'/><link rel='alternate' type='text/html' href='http://railsthinker.blogspot.com/2007/08/ajax-in-rails.html' title='Simple AJAX concept : observe_field'/><author><name>Gokul</name><uri>http://www.blogger.com/profile/07338758897103206804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_02M0qGMwH0c/ShbAQSY4SCI/AAAAAAAAAAw/cBKqsgXy3Uw/S220/100_1678.jpg'/></author><thr:total>0</thr:total></entry></feed>
