Forum: Ruby on Rails serving D3

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ryan Moore (Guest)
on 2013-08-04 20:40
(Received via mailing list)
I'm trying to use D3, a javascript data visualization library in my
app. The problem is that I can't figure out where to put the d3.js
and my .json data so that rails will serve it.

My problem is in the way d3 issues a GET request when it looks for my
and d3.js files.

Things I tried:
- setting up a static pages folder that is served with high_voltage gem.
This didn't work for me as I couldn't get around my application layout
it wrapped my js and json in html. I think this is why this didn't work.
- putting the files to be served in the public folder. This didn't work
because it couldn't find the routes for the public folder. I did turn on
config.serve_static_assets in the production enviroment config file.

I feel like this question should have a simple answer as everything
perfectly if I put my html, json and d3.js files into a folder and start
simple python http server in that folder. I think my problem is in my
understanding of the way rails is trying to serve things.

This topic is locked and can not be replied to.