Make it work with rails4