refactoring for using latest version of Angular (v.1.0.5) and Rails (v.3.2.13)