i thought rails does this already... stupid rails!