Sunday, July 15, 2012

Installing downloaded gem using bundler rails

Extract the .gem file into a new directory. After extracting, copy that directory into /vender/gems directory of your application. add the gem into the gemfile( gem "GemName", "Version", :path => "vendor/gems/Gem Directory Name".) . after that run bundle install. Enjoy.

Tuesday, May 15, 2012

Auto refresh page

"<script language="javascript" type="text/javascript">setTimeout("location.reload();",20000);</script>"

Monday, December 19, 2011

ruby step iterator


A loop from 0 to 12 by 3 can be written as follows.
0.step(12, 3) {|x| print x, " " }
produces:
0 3 6 9 12