Rails4

hi, I have modified the code, support rails4