rails -> hapi