Added the support for rails3