I am trying to implement the particles effect on my ruby on rails project but after following some tutorials and the github instruction of the particles package available I am not getting the effect on my local server even when I am specifying a grey background. Maybe you can suggest which one is my error or what I am missing. Here is my code.
Application.js
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require particles.js
//= require app.js
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
Application.css
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require_tree .
*= require_self
*/
back.css
#particles-js{
backgorund: #444;
}
home.html.erb
<h1>Rubsol#home</h1>
<p>Find me in app/views/rubsol/home.html.erb</p>
<div id="particles-js"></div>
I am not putting the lines
<script src="particles.js"></script>
<script src="particles.js"></script>
because I think they are not required since I am using //= require_tree but I also tried putting them and it does not show anything.
back.css was only created in order to set the color of the backgorund of the particles effect and I am not posting the content of particles.js and app.js because I did not change anything of those files, they are the same ones that you can download from github.
https://github.com/VincentGarreau/particles.js/
Here is what I get:

I solved it what I did is modify the app.js file as follows:
So as I am working in the console level I must change the name of the app.js file by the main.js as I am working directly in java language.Apart from that I remove the particles.js file and I used the particles.min.js file in the vendor folder and as a result I had to use //= require particles.min in the application.js file. If you know any other way to make it work or you can explain it in a better way or add some details to my answer you are welcome.