sample code for ruby on rails