convert to rails 4