Fix routes and models for rails 4