Jul 23, 2014

Weirdness of Bigdecimal.new

Recently i was bitten by this weirdness of BigDecimal in Ruby.BigDecimal.new excepts initial value and number of significant digits. In one of my app, BigDecimal.new was called with string initial

Jul 20, 2014

Setting up ispell and Emacs on Mac OS X

I was trying to setup flyspell mode on new Mac and whenever i doflyspell-buffer but Emacs was throwing error -Problem - Flyspell does not work with Emacs. Can't find ispell. Mac OS X

Feb 23, 2014

Devise : Passing params to after_* paths

Devise allows us to customize after_signup_path by overriding a protectedmethod in RegistrationsController.class RegistrationsController < Devise::RegistrationsController protected def after_inactive_sign_up_path_for(resource) your_custom_path end def

Jan 19, 2014

VERP on Rails

We sent newsletter campaigns from our Rails app. One of the main requirement of such campaign is how many emails bounced?. We need to track all bounced emails and map them again to

Jan 18, 2014

jQuery append and clone

I was trying to append some part of the DOM to some other element of the page.<div id='container'> <ul class='contacts_list'> </ul> </div&

Dec 21, 2013

Enable minitest again

If you have skipped minitest/test-unit while creating a rails app with -T or want to move to minitest from rspec or want to start with minitest in an existing rails project without

Oct 26, 2013

Facebook app with multiple subdomains

I had a requirement of adding facebook integration with our Rails app. I am using omniauth-facebook gem for the authentication part and it works great.Our app has multiple subdomains for all clients,

Oct 26, 2013

Preload associations with `find_by_sql`

I have a very complex query which is made up of more than 1 subqueries. Arel is awesome, but it can’t generate that query. So i generate those subqueries separately and combine

Oct 14, 2013

Conditional where in rails

T.L.D.RYou can pass blank object to where clause and it will return current relation as it is.Long versionSometimes, we need to apply where clause conditionally. For eg. apply timeframe

Apr 20, 2013

jenkins on fedora with rails

Installing jenkins on Fedora is quite easy.$ sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo $ sudo rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.