Deploying Rails app in subdomains of Rails app


I’ve got a Rails app deployed at I need to deploy
copies of that app to subdomains like,, etc. Each subdomain could use the same app code,
but each must have it’s own database. (They also need their own
images, stylesheets, etc.) None of the examples I’ve been able to
Google up have that characteristic. They all assume a shared database
with the subdomain’s data being filtered in the model. I would really
appreciate any thoughts / experience / pointers to stuff I’ve missed in
my Googling that might put me on the right track re: how to deploy this.