the code for rails