<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Vinsol - Leading Ruby on Rails Development and Consulting Firm in India &#187; ror</title>
	<atom:link href="http://vinsol.com/blog/category/ror/feed/" rel="self" type="application/rss+xml" />
	<link>http://vinsol.com/blog</link>
	<description></description>
	<lastBuildDate>Mon, 26 Jul 2010 08:37:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Rails Hackfest August-07 Results</title>
		<link>http://vinsol.com/blog/2007/09/05/rails-hackfest-august-07-results/</link>
		<comments>http://vinsol.com/blog/2007/09/05/rails-hackfest-august-07-results/#comments</comments>
		<pubDate>Thu, 06 Sep 2007 03:11:41 +0000</pubDate>
		<dc:creator>SUR</dc:creator>
				<category><![CDATA[RubyonRails]]></category>
		<category><![CDATA[hackfest]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://expressica.com/2007/09/05/rails-hackfest-august-07-results/</guid>
		<description><![CDATA[





No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.workingwithrails.com/hackfest/14-monthly-august-2-7" title="August Rails Hackfest Results"><br />
<img src='http://expressica.com/wp-content/uploads/2007/09/hackfest_winner1.png' alt='Hackfest Winners' /><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2007/09/05/rails-hackfest-august-07-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails Hackfest August-07</title>
		<link>http://vinsol.com/blog/2007/09/02/rails-hackfest-august-07/</link>
		<comments>http://vinsol.com/blog/2007/09/02/rails-hackfest-august-07/#comments</comments>
		<pubDate>Sun, 02 Sep 2007 07:25:41 +0000</pubDate>
		<dc:creator>SUR</dc:creator>
				<category><![CDATA[RubyonRails]]></category>
		<category><![CDATA[hackfest]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://expressica.com/2007/09/02/rails-hackfest-august-07/</guid>
		<description><![CDATA[I participated in August Rails Hackfest which was a great experience.
You can see the missing August 2007 from the Post Archives. I didn&#8217;t post anything last month as I was busy in submitting rails patches. I submitted a lot of patches out of which I got one patch committed to the rails code under changeset [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I participated in <a href="http://workingwithrails.com/hackfest/14-monthly-august-2-7">August Rails Hackfest</a> which was a great experience.<br />
You can see the missing August 2007 from the Post Archives. I didn&#8217;t post anything last month as I was busy in submitting rails patches. I submitted a lot of patches out of which I got one patch committed to the rails code under <a href="http://dev.rubyonrails.org/changeset/7362">changeset 7362</a> which was about optimizing the code of ActiveRecord Validation validates_presence_of filed under the <a href="http://dev.rubyonrails.org/ticket/9392">ticket 9392</a>. Me and <a href="http://workingwithrails.com/person/2780-chris-kampmeier">kampers</a> got a collaborated patch accepted under the <a href="http://dev.rubyonrails.org/changeset/7383">changeset 7383</a> which was a tiny patch for improving documentation of Action Controller filed under the <a href="http://dev.rubyonrails.org/ticket/9454">ticket 9454</a>. Many of my patches got rejected as well by the more experienced Rails Contributors but still, many patches are there to be analyzed by the <a href="http://rubyonrails.org/core">Rails Core Team</a>. </p>
<p>As I got my code embedded in the Rails Core, I am proud to be recognized as <b>Rails Core Contributor</b>. <a href="http://workingwithrails.com/person/7168-tarmo-t-nav">Tarmo</a> was one of the most active and really appreciable contributor in August Rails Hackfest. Because of this participation I paid very less attention to the other important things including the clients&#8217; projects as well :D. Moreover in the middle of the month I needed to go out to give Rails Training to a really enthusiastic team of a Bangalore based company. It was lovely experience there, but I got out of touch from the Hackfest for those crucial 5 days. After returning back I tried to keep the pace again. I am desperately waiting for the result of the August Rails Hackfest which might get published in a day or two. The first prize is the Entry Pass to the <a href="http://www.railsconfeurope.com/">RailsConfEurope</a>. I am looking for submitting more patches now onwards but not with the same pace as of last month, coz I will not be participating in the Hackfest but keeping the spirit of Rails Core Contributor and the pay back policy of open source. I will also be releasing some rails plugins and probably a ruby gem as well this month.</p>
<p>Have you tried this..</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
Object === Class == Class === Object
</textarea>
]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2007/09/02/rails-hackfest-august-07/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Second delhi.rb meetup &#8211; Some Advance Ruby Skills</title>
		<link>http://vinsol.com/blog/2007/07/20/second-delhirb-meetup-some-advance-ruby-skills/</link>
		<comments>http://vinsol.com/blog/2007/07/20/second-delhirb-meetup-some-advance-ruby-skills/#comments</comments>
		<pubDate>Fri, 20 Jul 2007 22:45:05 +0000</pubDate>
		<dc:creator>SUR</dc:creator>
				<category><![CDATA[RubyonRails]]></category>
		<category><![CDATA[advance_ruby]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[delegation]]></category>
		<category><![CDATA[delhi.rb]]></category>
		<category><![CDATA[duck typing]]></category>
		<category><![CDATA[metaprogramming]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://expressica.com/2007/07/20/second-delhirb-meetup-some-advance-ruby-skills/</guid>
		<description><![CDATA[Hey Everyone,
Vinsol is proudly taking charge to spread Rubyism in delhi and to grow the Ruby &#038; Rails communities here in New Delhi, India. We are organizing delhi.rb meetups around once every month, the meetup is all about ruby and rails as well. The meetup was on 19th July 2007 was our second meetup, first [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Hey Everyone,<br />
<a href="http://vinsol.com">Vinsol</a> is proudly taking charge to spread Rubyism in delhi and to grow the Ruby &#038; Rails communities here in New Delhi, India. We are organizing <a href="http://ruby.meetup.com/108/">delhi.rb</a> meetups around once every month, the meetup is all about ruby and rails as well. The meetup was on 19th July 2007 was our second meetup, first was on 22nd June 2007.</p>
<p><b>Manik presenting SOLR</b><br />
<img src="http://farm2.static.flickr.com/1309/857758434_7c48720bf0.jpg?v=0" alt="Manik presenting SOLR"/></p>
<p><hr /><br />
<b>Me presenting Some Advance Ruby Skills</b><br />
<img src="http://farm2.static.flickr.com/1042/857784340_823c25521d.jpg?v=0" alt="Me presenting Some Advance Ruby Skills"/></p>
<p>More photos <a href="http://www.flickr.com/photos/tags/delhirb/">here</a>.</p>
<p>It was really a nice experience attending the meetup, sharing the ruby/rails thoughts and upcoming features. It helps keeping yourself up-to-date with the latest trends in this technology domain at least in Ruby and Rails(what else m talking except ruby :D). So, there were two presentations in the meetup &#8212; first <a href="http://fromdelhi.com">Manik</a> presented <b>Full text search implementation for Rails using SOLR</b>(it was really an interesting presentation, i got SOLR learning for free, thanks Manik :)), second <a href="http://expressica.com/me">I</a> presented <b>Some Advance Ruby Skills</b> which i am going to share in this post too. Though in the first meetup I presented <b>Caching on RubyOnRails</b> but i haven&#8217;t posted here&#8230;</p>
<h3>Some Advance Ruby Skills</h3>
<p></p>
<h4>1.) Everything is object</h4>
<p>A popular phrase about Ruby, &#8220;Everything is Object&#8221;. At the root of the ruby it is Object. Everything we define in ruby is object. Even the classes we define are actually object. A class defined with <b>class ClassName; end</b> is actually an object of the class <b>Class</b>.<br />
The Object keeps the record of whatever class or module we define. We can justify it as</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  class Klass
  end
  Object.constants.include?("Klass")  # => true
</textarea>
<h4>2.) module_eval</h4>
<p>Use module_eval to define instance and class methods of a class at runtime, when you are outside the class.<br />
<b>example 1</b><br />
defining an instance method</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  class C
  end
  
  C.module_eval do
    define_method :wish do
      p "hello instance method"
    end
  end
  
  c = C.new
  c.wish # => hello instance method
</textarea>
<p><b>example 2</b><br />
defining a class method</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  class C
  end
  
  C.module_eval do
    class << self
      define_method :wish do
        p "hello class method"
        end
    end
  end

  C.wish # => hello class method
</textarea>
<p><b>example 3</b><br />
<b>another form of using module_eval</b><br />
when method body is available as a String object</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  class D
    class << self
      def method_body
        ret =<<-EOS
          def wish
            p "hello, supplied as String object"
          end
        EOS
      end
    end
    
    class C
    end
   
    c = C.new
    
    c.class.module_eval(D.method_body)
   
    c.wish # => hello, supplied as String object
  end
</textarea>
<h4>3.) alias_method</h4>
<p>It is NOT method call delegation but insertion of customized functionalities on a specific method call.</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  class C
    
    def wish
      p "hello"
    end
    
  end

  c = C.new
  c.wish # hello

  class D
    
    class << self
        def keep_some_record
          p "I am keeping some records"
        end
      end
      
  end

  # aliasing the wish method

  c.class.module_eval do
    
    alias_method :wish_orig, :wish
    
    define_method :wish do  
      D.keep_some_record
      wish_orig
    end
    
  end

  c.wish # I am keeping some records; hello
</textarea>
<h4>4.) The Anonymous class</h4>
<p>I just presented same a la <a href="http://expressica.com/2007/03/04/class_self_self_end/">this post</a></p>
<h4>5.) send</h4>
<p>Calling a method when method name is stored as a string object in a variable i.e. you can not see which method to call.<br />
<b>example 1</b><br />
when method name is simply stored as a String object</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
 class C   
    def wish
      p "hello DELHI.rb"
    end
  end
  a = "wish"
  c  = C.new 
  c.send(a)
</textarea>
<p><b>example 2</b><br />
making set method at runtime</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  class C
    attr_accessor :name
  end
  
  c = C.new
  
  a = "name"
  
  c.send(a + "=", "SUR MAX")
  
  p c.send(a)
</textarea>
<p><b>example 3</b><br />
this is interesting, when attribute name itself is <b>send</b></p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  class C
    attr_accessor :send
  end
  
  c = C.new
  
  a = "send"
  
  c.__send__(a + "=", "SUR MAX")
  
  p c.__send__(a) # => Sur Max
</textarea>
<p>well, don&#8217;t say &#8220;what if attribute name is __send__&#8221; <img src='http://expressica.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<h4>6.) The Method class</h4>
<p>Methods of the class are objects of the Method class when retrieved with the method <b>method</b> and can be called with the method <b>call</b>.<br />
<b>example 1</b><br />
anything we define with def-end is an object of the class Method</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  class C    
     def wish
        p "hello"
      end
   end

  c = C.new
  
  m1 = c.method("wish")
  
  p m1.class # => Method

  m1.call # => hello
</textarea>
<p><b>example 2</b><br />
method can hold the object&#8217;s reference and associated instance variables</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  class C
    attr_accessor :name
    
    def initialize(name)
      self.name = name.to_s 
      end
    
    def wish
      p "hello " + name.to_s
    end  
  end
  
  
  c = C.new("Sur Max")
  
  m1 = c.method("wish")
  m1.call # => hello Sur Max
</textarea>
<p><b>example 3</b><br />
we are able to let this method object flow throughout the application code and let it available anywhere in the code.</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  class C
    attr_accessor :name
    
    def initialize(name)
      self.name = name.to_s 
      end
    
    def wish
      p "hello " + name.to_s
    end
    
    def self.supply_wish
      c = new("Sur Max")
      return c.method("wish")
    end
    
  end

  C.supply_wish.call # => hello Sur Max
</textarea>
<h4>7.) what is &#8220;self&#8221;</h4>
<p>I just presented a la <a href="http://expressica.com/2007/04/05/self_realization/">this post</a></p>
<h4>8.) Single Method Delegation - using Forwardable</h4>
<p>Allows you to delegate named method calls to other objects.</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  require 'forwardable'
  
  class C 
    extend Forwardable
    
    attr_accessor :h
    
    def initialize
      @h = {}
    end
    
    def_delegator(:@h, :[], :show)
    def_delegator(:@h, :[]=, :add)
    
  end
  
  end

  c = C.new

  c.add(1, "asdf")

  p c.show(1)

  p c.h
</textarea>
<p>Notice the beauty of ruby here&#8230; The methods [], []= of a hash object are usually called as</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  h = {}
  h["key"] # this will return the corresponding value
  h["key"] = "value" # this will set the "value" corresponding to the "key"
</textarea>
<p>BUT in the above delegation code we are calling them as(delegating the method call on them as)</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  h = {}
  h.[]("key") # this will return the corresponding value
  h.[]=("key", "value") # this will set the "value" corresponding to the "key"
</textarea>
<h4>9.) Full class Delegation - using Delegator</h4>
<p>Extending an object(instance of Class) with the capabilities of another.</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  require 'delegate'

  class Words < DelegateClass(Array)
    
    def initialize(list = "one two three four")
      super(list.split)
    end

  end


  w = Words.new

  p w # => ["one", "two", "three", "four"]

  p w.length # => 4

</textarea>
<h4>10.) SimpleDelegator</h4>
<p>Write memory optimized code with SimpleDelegator&#8230;</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
require 'delegate'
  
  a = SimpleDelegator.new([10, 20])
  
  old_id = a.__id__
  
  b = a
  
  a.__setobj__("a new object") # this is not possible otherwise with the method "replace" which can replace only object of same class on same memory location
  
  new_id = a.__id__
  
  p a # => "a new object"
  p b  # => "a new object"

  p new_id == old_id # => true
</textarea>
]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2007/07/20/second-delhirb-meetup-some-advance-ruby-skills/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install RMagick Gem on Linux/Ubuntu</title>
		<link>http://vinsol.com/blog/2007/07/04/how-to-install-rmagick-gem-on-linuxubuntu/</link>
		<comments>http://vinsol.com/blog/2007/07/04/how-to-install-rmagick-gem-on-linuxubuntu/#comments</comments>
		<pubDate>Wed, 04 Jul 2007 12:08:55 +0000</pubDate>
		<dc:creator>SUR</dc:creator>
				<category><![CDATA[RubyonRails]]></category>
		<category><![CDATA[feisty fawn]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://expressica.com/2007/07/04/how-to-install-rmagick-gem-on-linuxubuntu/</guid>
		<description><![CDATA[While installing RMagick on Linux, if you are getting errors like this
&#8220;GraphicsMagick-config&#8230; no configure: error: Can&#8217;t install RMagick. Can&#8217;t find Magick-config or GraphicsMagick-config program. &#8230;&#8221;,
below is the solution for this error.
RMagick requires ImageMagick and which further requires loads of dependencies already available to get installed and work properly. I was figuring out of those all, [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>While installing RMagick on Linux, if you are getting errors like this<br />
&#8220;GraphicsMagick-config&#8230; no configure: error: Can&#8217;t install RMagick. Can&#8217;t find Magick-config or GraphicsMagick-config program. &#8230;&#8221;,<br />
below is the solution for this error.</p>
<p>RMagick requires ImageMagick and which further requires loads of dependencies already available to get installed and work properly. I was figuring out of those all, and thank god got a quite simple and elegant way to do all that in just three commands.<br />
First you will have to install imagemagick then libmagick9-dev and then finally you can install rmagick. </p>
<p>Here are the commands&#8230;</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  sudo apt-get install imagemagick
  sudo apt-get install libmagick9-dev
  sudo gem install rmagick
</textarea>
]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2007/07/04/how-to-install-rmagick-gem-on-linuxubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plugin: Validate Attributes &#8211; validate one or more specific attributes</title>
		<link>http://vinsol.com/blog/2007/05/21/plugin-validate-attributes-validate-one-or-more-specific-attributes/</link>
		<comments>http://vinsol.com/blog/2007/05/21/plugin-validate-attributes-validate-one-or-more-specific-attributes/#comments</comments>
		<pubDate>Mon, 21 May 2007 06:30:37 +0000</pubDate>
		<dc:creator>SUR</dc:creator>
				<category><![CDATA[RubyonRails]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[validate_attributes]]></category>

		<guid isPermaLink="false">http://expressica.com/2007/05/20/validate_attributes/</guid>
		<description><![CDATA[Hi all,
I found an answer(a tweak) to the question which was pinging my mind while working on my current project that How to validate one or more specific attribute of the model(field of the table i mean)?, as the requirement was to save a record after validating the model&#8217;s object through 4 steps ie. 4 [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Hi all,<br />
I found an answer(a tweak) to the question which was pinging my mind while working on my current project that <b>How to validate one or more specific attribute of the model(field of the table i mean)?</b>, as the requirement was to save a record after validating the model&#8217;s object through 4 steps ie. 4 different forms. Although i found something in the Rails API to put some step constraints on the validations in the model, but i didn&#8217;t find it that much flexible so i wrote a snippet which validates one or more specific attributes and can also save the record on the basis of validating specific attributes. Then i thought to pluginize it, as it might be useful</p>
<p>Check out the plugin <a href="http://expressica.com/plugins/validate_attributes"><b>Validate Attributes</b></a><br />
It provides a simple way to validate specific attribute(s) unlike the function <b>valid?</b> which collectively validates all the attributes.</p>
<p>For more information about the plugin regarding SVN repository, usage, example please <a href="http://expressica.com/plugins/validate_attributes"><b>visit here</b></a></p>
<p>If you like/dislike the plugin or if you have some issue/conflict, please do not forget to post a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2007/05/21/plugin-validate-attributes-validate-one-or-more-specific-attributes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Captcha Released</title>
		<link>http://vinsol.com/blog/2007/02/06/simple-captcha-released/</link>
		<comments>http://vinsol.com/blog/2007/02/06/simple-captcha-released/#comments</comments>
		<pubDate>Wed, 07 Feb 2007 01:38:04 +0000</pubDate>
		<dc:creator>Sur Max</dc:creator>
				<category><![CDATA[RubyonRails]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ror]]></category>

		<guid isPermaLink="false">http://ajaxonrails.wordpress.com/2007/02/07/simple-captcha-released/</guid>
		<description><![CDATA[Hey guys, finally i have released the captcha plugin for public usage.
Check it out  here



No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><p>Hey guys, finally i have released the captcha plugin for public usage.</p>
<p>Check it out <a href="http://expressica.com/2007/02/06/simple-captcha-released-the-captcha-for-rails-applications/"> <b>here</b></a></p>
</div>]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2007/02/06/simple-captcha-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sample Rails Application &#8211; A demo for the ajax based drag drop tree in rubyonrails</title>
		<link>http://vinsol.com/blog/2006/11/26/sample-rails-application-a-demo-for-the-ajax-based-drag-drop-tree-in-rubyonrails/</link>
		<comments>http://vinsol.com/blog/2006/11/26/sample-rails-application-a-demo-for-the-ajax-based-drag-drop-tree-in-rubyonrails/#comments</comments>
		<pubDate>Sun, 26 Nov 2006 09:44:31 +0000</pubDate>
		<dc:creator>Sur Max</dc:creator>
				<category><![CDATA[RubyonRails]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ajax tree]]></category>
		<category><![CDATA[drag drop tree]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[tree]]></category>

		<guid isPermaLink="false">http://ajaxonrails.wordpress.com/2006/11/26/ajaxonrailsdragdroptree/</guid>
		<description><![CDATA[I have provided the source code of the ajax based drag drop tree in rubyonrails in one of my previous posts.
I found some of the people are getting problems to incorporate the code into their running applications so i am providing a sample rails application in which all the code for tree is already been [...]


Related posts:<ol><li><a href='http://vinsol.com/blog/2009/11/16/11-things-to-consider-before-deploying-your-rails-application/' rel='bookmark' title='Permanent Link: 11 Things to Consider Before Deploying Your Ruby on  Rails Application'>11 Things to Consider Before Deploying Your Ruby on  Rails Application</a> <small>At VinSol, we have been developing and deploying Rails applications...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'>
<p>I have provided the <a href="http://ajaxonrails.wordpress.com/2006/08/18/sorce-code-for-ajax-based-drag-drop-navigation-tree-for-rails/"><strong>source code</strong></a> of the ajax based drag drop tree in rubyonrails in one of my previous posts.<br />
I found some of the people are getting problems to incorporate the code into their running applications so i am providing a sample rails application in which all the code for tree is already been placed well.<br />
However the code written seems to be lagged behind the current trends followed in rails development coz of the fire growth of rails itself, but its simply that when i wrote this tree i was very new to rails so you may find the code looks like an old wine but still tastes good to go with.</p>
<p>CHECK THIS OUT&#8230;</p>
<p><strong>Four simple steps to make the tree working&#8230;</strong></p>
<ol>
<li><a href="http://rubyforge.org/frs/download.php/15381/ajaxtree.zip"><strong>DOWNLOAD</strong></a> the sample application. (let me know if you are getting any error in downloading the application.)</li>
<li>Create a <strong>test</strong> database in mysql <strong>or</strong> modify the file <strong>/config/database.yml</strong> according to the database and user u need.</li>
<li>Run the command
<pre>ajaxtree&gt; rake db:migrate</pre>
<p>from the application root.</li>
<li>Run the application server by running
<pre>ajaxtree&gt; ruby script/server</pre>
<p>and watch the working tree at <strong>http://localhost:3000</strong></li>
</ol>
</div>


<p>Related posts:<ol><li><a href='http://vinsol.com/blog/2009/11/16/11-things-to-consider-before-deploying-your-rails-application/' rel='bookmark' title='Permanent Link: 11 Things to Consider Before Deploying Your Ruby on  Rails Application'>11 Things to Consider Before Deploying Your Ruby on  Rails Application</a> <small>At VinSol, we have been developing and deploying Rails applications...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2006/11/26/sample-rails-application-a-demo-for-the-ajax-based-drag-drop-tree-in-rubyonrails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integration Testing in Ruby on Rails — How to maintain sessions while testing in Rails</title>
		<link>http://vinsol.com/blog/2006/11/02/integration-testing-in-ruby-on-rails-%e2%80%94-how-to-maintain-sessions-while-testing-in-rails/</link>
		<comments>http://vinsol.com/blog/2006/11/02/integration-testing-in-ruby-on-rails-%e2%80%94-how-to-maintain-sessions-while-testing-in-rails/#comments</comments>
		<pubDate>Thu, 02 Nov 2006 17:52:38 +0000</pubDate>
		<dc:creator>Sur Max</dc:creator>
				<category><![CDATA[RubyonRails]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[tests]]></category>

		<guid isPermaLink="false">http://ajaxonrails.wordpress.com/2006/11/02/integration-testing-in-ruby-on-rails-how-to-maintain-sessions-while-testing-in-rails/</guid>
		<description><![CDATA[Well, its a natural feel to get amazed out of every other delighted  feature provided by RubyonRails and so appreciating it before actually talking about the feature in every second post. This line is for those people who have published that the worst thing about rails is that every rails programmer always just focus [...]


Related posts:<ol><li><a href='http://vinsol.com/blog/2010/04/01/ssl-checklist-for-rails-applications/' rel='bookmark' title='Permanent Link: SSL checklist for Ruby on Rails Applications'>SSL checklist for Ruby on Rails Applications</a> <small>Cross posted from darthsid The purpose of SSL is to...</small></li>
<li><a href='http://vinsol.com/blog/2009/09/07/rails-caching-and-javascript-techniques/' rel='bookmark' title='Permanent Link: Ruby on Rails Caching And JavaScript Techniques'>Ruby on Rails Caching And JavaScript Techniques</a> <small>Cross posted from darthsid While implementing caching in a recent...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'>
<p>Well, its a natural feel to get amazed out of every other delighted  feature provided by RubyonRails and so appreciating it before actually talking about the feature in every second post. This line is for those people who have published that the worst thing about rails is that every rails programmer always just focus on the appreciation of rails and not on the framework per se. As i think  the reason behind his(let say)  perception is that he might not have tried rails and probably in all posts he have been through yet is that he would have got jealous out of gaining popularity of <strong>ruby on rails</strong> over <strong>jsp</strong> and <strong>asp</strong> and else, and therefore he might not be reading the whole post due to which he just remained untouched with the real appreciable features.<br />
<strong>Anyhow, here is my post on a fantastic rails feature &#8211; Integration Testing&#8230;</strong><br />
RoR is the only web application  framework which provides an inbuilt high level of testing. Out of the whole testing the most interesting real time testing is <strong>Integrations Testing</strong> where you can synchronize with the sessions too unlike in the <strong>Functional Testing</strong>.</p>
<p><strong>Where exactly we should use Integration Testing ?</strong><br />
Whenever we need to test a series of functionalities which belongs to more than one controller , we should go for Integration Testing and not the Functional one.</p>
<p>Since the functional and unit testing are controller and model centric respectively, rails automatically creates the related functional and unit tests files. But as integrations testing is not confined in any criteria of a specific controller or model, we have to create the integrations file manually&#8230; Well, nothing is headache in rails. Its a simple pre-written script, all you need is to call that script with a name you like for whole story you wish to test in the integration test.</p>
<p><strong>Here is a real example of Integration Test in Ruby on Rails</strong></p>
<p>Considerations for test&#8230;<br />
We will simply test</p>
<ul>
<li>signing in</li>
<li>posting a new article</li>
<li>deleting an article with xml_http_request (ajax post request)</li>
</ul>
<p>Create the test file by running</p>
<pre><code>
ruby script/generate integration_test initial_features
</code></pre>
<p>Make sure that now you have the file <strong>/test/integration/initial_features_test.rb</strong>. Rails automatically appends <strong>_test</strong> at the end of the file name.</p>
<p><strong>For god sake Lets start the testing now <img src='http://ajaxonrails.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </strong><br />
Code for the file <strong>/test/integration/initial_features_test.rb</strong></p>
<pre><code>
require "#{File.dirname(__FILE__)}/../test_helper"

class InitialFeaturesTest &lt; ActionController::IntegrationTest
  fixtures :users, :articles

  def test_initial_features
     user = user_for_test
     user.try_to_signin
     user.signin
     user.post_an_article
     user.delete_an_article_with_xhr
  end

  def user_for_test
    open_session do |user|
      def user.try_to_signin
        assert_nil session[:user] # assert_session_has &amp; _has_no have been deprecated
        get "user/signin"
        assert_response :success
        post "user/signin", :email=&gt;"test failure string", :password=&gt;"test failure string"
        assert_nil session[:user]
      end
      def user.signin
        assert_nil session[:user]
        user = users(:first)
        post "user/signin", :email=&gt;user.email, :password=&gt;user.password
        assert_not_nil session[:user]
        assert_response :redirect
        assert_redirected_to "articles/show"
        # now as the session is set once, we need not to signin again
      end
      def user.post_an_article
        get "articles/show"
        assert_response :success
        assert_template "articles/show"
        user = session[:user]
        articles_count = user.articles.length
        post_via_redirect "article/new", :title=&gt;"Integration Tetsing in Rails", :description=&gt;"another relishing rails feature"
        assert_template "articles/show"
        assert_equal articles_count.next, user.reload.articles.length
      end
      def user.delete_an_article_with_xhr
        user = session[:user]
        articles_count = user.articles.length
        xml_http_request "articles/delete", :id=&gt;articles(:first).id
        assert_equal articles_count-1,user.reload.articles.length
      end
    end
  end

end
</code></pre>
<p>Although these are not that high level integration tests that rails can provide but its just an overview on the integration tests. I will explain them soon.</p>
</div>


<p>Related posts:<ol><li><a href='http://vinsol.com/blog/2010/04/01/ssl-checklist-for-rails-applications/' rel='bookmark' title='Permanent Link: SSL checklist for Ruby on Rails Applications'>SSL checklist for Ruby on Rails Applications</a> <small>Cross posted from darthsid The purpose of SSL is to...</small></li>
<li><a href='http://vinsol.com/blog/2009/09/07/rails-caching-and-javascript-techniques/' rel='bookmark' title='Permanent Link: Ruby on Rails Caching And JavaScript Techniques'>Ruby on Rails Caching And JavaScript Techniques</a> <small>Cross posted from darthsid While implementing caching in a recent...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2006/11/02/integration-testing-in-ruby-on-rails-%e2%80%94-how-to-maintain-sessions-while-testing-in-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RoR(Ruby on Rails) in India &#8211; Ruby on Rails based Indian Company</title>
		<link>http://vinsol.com/blog/2006/10/25/rorruby-on-rails-in-india-ruby-on-rails-based-indian-company/</link>
		<comments>http://vinsol.com/blog/2006/10/25/rorruby-on-rails-in-india-ruby-on-rails-based-indian-company/#comments</comments>
		<pubDate>Wed, 25 Oct 2006 07:48:08 +0000</pubDate>
		<dc:creator>Sur Max</dc:creator>
				<category><![CDATA[India]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ror]]></category>

		<guid isPermaLink="false">http://ajaxonrails.wordpress.com/2006/10/25/rorruby-on-rails-in-india-ruby-on-rails-based-indian-company/</guid>
		<description><![CDATA[Ruby on Rails is creating the storms in the web development all over the world. RoR is even capable to challenge Big Caps  like Microsoft&#8217;s Asp.NET and so everything else in the specific area. World is continuously changing&#8230; The current WEB not solely depends on the old,encoded,paid,stressful technologies but the fresh,open-source,free,joyful technologies like Ruby [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><p>Ruby on Rails is creating the storms in the web development all over the world. RoR is even capable to challenge <strong>Big Caps </strong> like Microsoft&#8217;s Asp.NET and so everything else in the specific area. World is continuously changing&#8230; The current <strong>WEB</strong> not solely depends on the <strong>old,encoded,paid,stressful</strong> technologies but the <strong>fresh,open-source,free,joyful</strong> technologies like <strong>Ruby on Rails</strong> are now creating the new highways to connect the <strong>WEB</strong>&#8230; What else ?.. Providing a beautiful atmosphere to web-developers. At the moment the whole world of web-development is cherishing the <strong>fresh breeze of RoR</strong>.<br />
<strong>How much of INDIA is delighted by Ruby on Rails ?</strong><br />
Currently, the INDIAN side of Rails is a small community&#8230;but growing at a rapid rate. I am proudly working at <a href="http://vinsol.com"><strong>VINSOL</strong></a>(New Delhi,India), a company full fledged working on rails.<br />
<a href="http://vinsol.com"><strong>VINSOL</strong></a> is currently holding some good clients for web-development and providing efficient services in Ruby on Rails.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2006/10/25/rorruby-on-rails-in-india-ruby-on-rails-based-indian-company/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Captcha in Ruby on Rails &#8211; Customize the use of captcha in the plugin validates_captcha</title>
		<link>http://vinsol.com/blog/2006/10/24/captcha-in-ruby-on-rails-customize-the-use-of-captcha-in-the-plugin-validates_captcha/</link>
		<comments>http://vinsol.com/blog/2006/10/24/captcha-in-ruby-on-rails-customize-the-use-of-captcha-in-the-plugin-validates_captcha/#comments</comments>
		<pubDate>Tue, 24 Oct 2006 18:59:40 +0000</pubDate>
		<dc:creator>Sur Max</dc:creator>
				<category><![CDATA[captcha]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[validations]]></category>

		<guid isPermaLink="false">http://ajaxonrails.wordpress.com/2006/10/24/captcha-in-ruby-on-rails-customize-the-use-of-captcha-in-the-plugin-validates_captcha/</guid>
		<description><![CDATA[To implement captcha in RubyonRails, validates_captcha plugin can be a good option but a small customization i need with this plugin was to use it on some specific action and not to be validated the captcha field every time an instance of the model is saved or updated.
Here is a small work-around for its customization&#8230;
How [...]


Related posts:<ol><li><a href='http://vinsol.com/blog/2010/04/01/ssl-checklist-for-rails-applications/' rel='bookmark' title='Permanent Link: SSL checklist for Ruby on Rails Applications'>SSL checklist for Ruby on Rails Applications</a> <small>Cross posted from darthsid The purpose of SSL is to...</small></li>
<li><a href='http://vinsol.com/blog/2010/04/09/introduction-to-active-scaffold-part-i/' rel='bookmark' title='Permanent Link: Introduction to Active Scaffold  Part I'>Introduction to Active Scaffold  Part I</a> <small>I originally wrote this article for fifth issue of Rails...</small></li>
<li><a href='http://vinsol.com/blog/2009/09/04/how-to-integrate-tinymce-with-redbox-in-5-steps/' rel='bookmark' title='Permanent Link: How to Integrate TinyMce with Redbox in 5 steps ?'>How to Integrate TinyMce with Redbox in 5 steps ?</a> <small>TinyMCE is a platform independent web based Javascript HTML WYSIWYG...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'>
<p>Hello Everyone !!<br />
I have released a captcha plugin <a href="http://expressica.com/2007/02/06/simple-captcha-released-the-captcha-for-rails-applications/"><b>Simple Captcha</b></a>. It is really simple to implement, and provides a cool feature of multiple styles of images.</p>
<p>
<hr />
<b>Previous Post for validates_captcha</b></p>
<hr />
To implement captcha in RubyonRails, <a href="http://svn.2750flesk.com/validates_captcha"><strong>validates_captcha</strong></a> plugin can be a good option but a small customization i need with this plugin was to use it on some specific action and not to be validated the captcha field every time an instance of the model is saved or updated.<br />
Here is a small work-around for its customization&#8230;<br />
<strong>How to use customized captcha in RoR ?</strong><br />
Install the plugin validates_captcha in your rails application by running this command from the root of your application</p>
<pre>
ruby script/plugin install http://svn.2750flesk.com/validates_captcha</pre>
<p>Make sure that you can now see the directory <strong>vedor/plugins/validates_captcha</strong>.</p>
<p>Now run these commands from your application root to make the image and data directories</p>
<pre>
  ruby script/generate captcha store_directory
  ruby script/generate captcha image_directory</pre>
<p>Here is the complete <a href="http://dev.2750flesk.com/validates_captcha/"><strong>API</strong></a> for the usage of this plugin. I am describing the same idea as given in this API but in a bit more specific means.</p>
<p>Lets consider a model <strong>User</strong> in which we will implement the captcha.<br />
Add the following code in the file <strong>app/models/user.rb</strong></p>
<pre>
  class User &lt; ActiveRecord::Base

    validates_captcha :if =&gt; :request_captcha_validation?
    attr_accessor :request_captcha_validation

    def request_captcha_validation?
      (self.request_captcha_validation==true)? true : false
    end

  end</pre>
<h3>Handle View and Controller</h3>
<p><strong>Add the code in the view inside your existing form.</strong></p>
<pre>
  &lt;% c = prepare_captcha :type =&gt; :image -%&gt;
  &lt;%= captcha_hidden_field c, 'user' %&gt;
  &lt;%= captcha_image_tag c %&gt;
  &lt;%= captcha_label 'user', 'Type in the text from the image above' %&gt;
  &lt;%= captcha_text_field 'user' %&gt;</pre>
<p><strong>Your controller will look like</strong></p>
<pre>
  def save
    # the line in bold represents that you need captcha validation.
    # if captcha validation is not required then remove this line from your controller.
    @user = User.new(params[:user])
    <strong>@user.request_captcha_validation = true</strong>
    @user.save
  end</pre>
<p>However image is too noisy and it contains repeated strings.<br />
To improve the quality of images generated by the plugin validates_captcha visit <a href="http://ajaxonrails.wordpress.com/2006/10/17/how-to-improve-the-image-quality-and-generate-random-string-image-in-the-plugin-validates_captcha/"><strong>Here</strong></a>.</p>
</div>


<p>Related posts:<ol><li><a href='http://vinsol.com/blog/2010/04/01/ssl-checklist-for-rails-applications/' rel='bookmark' title='Permanent Link: SSL checklist for Ruby on Rails Applications'>SSL checklist for Ruby on Rails Applications</a> <small>Cross posted from darthsid The purpose of SSL is to...</small></li>
<li><a href='http://vinsol.com/blog/2010/04/09/introduction-to-active-scaffold-part-i/' rel='bookmark' title='Permanent Link: Introduction to Active Scaffold  Part I'>Introduction to Active Scaffold  Part I</a> <small>I originally wrote this article for fifth issue of Rails...</small></li>
<li><a href='http://vinsol.com/blog/2009/09/04/how-to-integrate-tinymce-with-redbox-in-5-steps/' rel='bookmark' title='Permanent Link: How to Integrate TinyMce with Redbox in 5 steps ?'>How to Integrate TinyMce with Redbox in 5 steps ?</a> <small>TinyMCE is a platform independent web based Javascript HTML WYSIWYG...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2006/10/24/captcha-in-ruby-on-rails-customize-the-use-of-captcha-in-the-plugin-validates_captcha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
