I'm new in Ruby and in ROR framework. I try to create web app with JQuery. My steps are:
//= require jquery2
added into application.js file<%= javascript_include_tag "application" %>
into application.html.erb filewhen I try to see page in browser I see error with message:
Sprockets::Rails::Helper::AssetNotFound in LandingPage#index
The asset "application.js" is not present in the asset pipeline.
<%= javascript_include_tag "application" %>
What I doing wrong? I googled about this error, but I didn't found anything good explained.
first of all try to restart your server, generally there is no need to include application.js
file in assets. if it doesn't work then
add below in your config/initializer/assets.rb
file:
Rails.application.config.assets.precompile += %w(application.js)
Note: after adding in your assets file, don't forget to restart your server. If you do any changes in Inilalizers, you have to restart the server to see the effects.