Implement solution for challenge using Rails