rails attempt to do what i failed to do in python/django