I have 4 files in app/javascript/packs:
application.js
jquery-3.4.0.min.js
jquery.raty.js
main.js
To the layout I have added:
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'main', 'data-turbolinks-track': 'reload' %>
and it works fine, but jquery.raty.js doesn't load.
I tried rake assets:precompile, but it still doesn't see jquery.raty.js, but it sees main.js, my custom js file.
WHat is the issue with it?
I tried
<%= javascript_include_tag 'jquery.raty.js', "data-turbolinks-track" => false %>
but it shows error: The asset "jquery.raty.js" is not present in the asset pipeline. I even added
Rails.application.config.assets.precompile += %w( jquery.raty.js )
to the asset, but it shows the same error.
3.0.0 :001 > Rails.application.config.assets.precompile => ["manifest.js", "jquery.raty.js"]
FOUND SOLUTION with <%= javascript_pack_tag 'jquery', 'data-turbolinks-track': 'reload' %>