I am building a Rails 4 web application and I want to include some .js files into my application. Is it possible to directly add JavaScript file to my Rails ..app/asse
Taking a look at the application.html.erb file, you'll see that the application.js was referenced via:
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
So when I had this challenge, what I did was: add this script in the file where I wanted to reference my custom javascript, but this time I modified the parameter. So instead of "application," I have this:
<%= javascript_include_tag "customjsFile", "data-turbolinks-track" => true %>
Hope this helps.