Fun with PHP and Rails