Code for ruby on rails project