About

Hi I'm Sandip Ransing, a ruby on rails developer in Pune (India).I did my bachelor in Computer Engineering from PES Modern College of Engineering, Pune.In July 2007, I started software development career in Java.After few months passed, I heard about ruby language from my friend Haribhau Ingale and got attention towards ruby and rails and … Continue reading About

Vim editor for ruby on rails development using rails.vim

Vim install On CentOSyum install vim-enhancedVim install on Ubuntu machineInstall vim-full using commandapt-get install vimWhile coding with ruby, html, erb, haml, js and stylesheets.It is great pain to indent code. Using rails vim one can easilykeep code always indented.This increases code readability and minimizes effort, bugs andfinally proves ease of using vim editor.rails.vim script contains … Continue reading Vim editor for ruby on rails development using rails.vim

Extend enumerable to add method collect_with_index

module Enumerable def collect_with_index(i=0) collect{|elm| yield(elm, i+=1)} end alias map_with_index collect_with_indexend #Example use : ree-1.8.7-2010.01 > ['ruby', 'rails', 'sandip'].map_with_index{ |w,i| [w, i] } #=> [["ruby", 1], ["rails", 2], ["sandip", 3]] ree-1.8.7-2010.01 > ['ruby', 'rails', 'sandip'].collect_with_index{ |w,i| [w, i] } #=> [["ruby", 1], ["rails", 2], ["sandip", 3]] #By default index starts from zero to specify custom … Continue reading Extend enumerable to add method collect_with_index