title: load json file from assets with javascript, Rails 5
body: <p>I'm using a javascript cdn and part of the requirements to use this particle.js is to load a json file from the assets directory. This is what my home.html.erb looks like.</p>
  
  <pre><code>&lt;div class="fluid-container" id="particles-js"&gt;
      &lt;h1&gt;Hello This is a test for particles.js&lt;/h1&gt;
      &lt;p&gt;Well does it work?&lt;/p&gt;
  &lt;/div&gt;
  
  &lt;script src="https://cdn.jsdelivr.net/npm/particles.js@2.0.0/particles.min.js"&gt;
  &lt;/script&gt;
  
  &lt;script&gt;
      particlesJS.load('particles-js', 'assets/particles.json', function(){
          console.log('particles.json loaded...');
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>I also created a particles.json at /app/assets/particles.json</p>
  
  <p>The result in the console is:</p>
  
  <p>particles.js:1539 GET <a href="http://localhost:3000/assets/particles.json" rel="nofollow noreferrer">http://localhost:3000/assets/particles.json</a> 404 (Not Found)</p>
  
  <p>Where should I actually put the particles.json file and how should I call it?</p>