Rails 4 Support

I don't if I am right. These are the changes I have made. So that it can work with my rails 4 apps.