I am trying not all JavaScripts to be used in all HTMLs.
The first thing I did was eliminate the require_tree.
Then I used this line in my view
<%= javascript_include_tag "fiscal", "data-turbolinks-track" => false %>
and I got this error:
Asset was not declared to be precompiled in production.
AddRails.application.config.assets.precompile += %w( judicial.js )
toconfig/initializers/assets.rb
and restart your server.
I did what the error says and install something called yarn. Then I ran this code in console:
$ bundle exec rake assets:precompile</code><br>
and I got this:
yarn install v1.3.2
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
info Lockfile not saved, no dependencies.
Done in 0.12s.
But it's still the same error. Please, I need to know where the error is or an alternative.