Implement for rails 4