Convert to rails 4