Monthly Archives: November 2009

Passing commandline parameter (arguments) to ruby file using optparser

Ruby file accepts from command prompt in the form of array. Passing parameters ruby input.rb TOI DH TimesNew Accessing parameters # input.rb p ARGV # => ["TOI", "DH", "TimesNew"] p ARGV[0] # => “TOI” p ARGV[1] # => “DH” Optparser … Continue reading

Posted in Ruby | Tagged | Leave a comment

How to get all associted models of rails model

I have Site Model and i wanted to find all associated models of Site model which are having belongs_to relationship.After doing lot headache, here is the solution i found has_many models of Site Model Site.reflect_on_all_associations.map{|mac| mac.class_name if mac.macro==:has_many}.compact=> [“Layout”, “User”, … Continue reading

Posted in Ruby on Rails | Tagged | Leave a comment

Cricket challenge flash game

Advanced cricket flash game http://img.bollywoodsargam.com/games/files/game_4f2a798477213b30a4802e716e31a9a6.swf

| Leave a comment