Particles.js with Ruby on Rails
By Chris Oliver from GoRails
Instructions
Here's how you can use this in Rails.
- Add particles.min.js to
/vendor/assets/javascripts
and add //= require particles.min
to application.js
- Add
<div id="particles-js"></div>
to your view
- If you want a static config, create a javascript file like
app/assets/javascripts/main.js and just write your JSON config as the second argument.
- If you want a dynamic config, you can create a JSON endpoint and
return the JSON config by specifying the url as the second parameter
in the particleJS()
call