Serving static directory in Rails

431 Views Asked by At

I have a simple rails app deployed to Heroku, and I'm trying to serve a static directory (containing an index.html) from the public/demos folder but running into a weird issue. I have config.serve_static_assets = true enabled in production, and if I go to mysite.com/demos/folder/, I can access the static page fine. But if I go to mysite.com/demos/folder (lacking a trailing slash), the index page loads but fails to load a bunch of linked css/js stuff located in the same directory. Is there any way around this or a better way to do it? I'm not sure what the best way is to serve static content with Rails, but this feels like a poor solution.

0

There are 0 best solutions below