here comes the rails4 code