My Problem
In my Rails 5 application I have 2 layouts, for this reason I need to set up multiple manifest files.
What I have done
I did the following:
The two
layouts
have auser.html.erb
and amain.html.erb
html file, there I linked with the correct tags myapplication.js
inuser.html.erb
and mymain.js
formain.html.erb
.The file loads, if I follow
localhost:3000/assets/application.js
the full content of the js files included in the manifest is displayed, while at/assets/main.js
are displayed only the following lines:(function() { }).call(this);
I Followed the instructions included in the following discussion Rails 4 Assets Precompilation with multiple manifest files, but they did not work
config.assets.precompile += %w( main.js )
I searched Stackoverflow and I read the documention, but no answer to this problem has ever been found. I am using:
* rails (5.0.1)
* sprockets (3.7.1)
* sprockets-rails (3.2.0)
Update
In main.js file I included the following as test:
//= require jquery
//= require bootstrap-sprockets
//= require jquery.easing