Rails implementation