Working on rails4

Now working on rails4.