How to import default js file in rails 3.1

in app\views\layouts\application.html.erb
when i write
<%= javascript_include_tag :defaults %> ,
i get

at source file.

<%= javascript_include_tag “application” %> gets


<%= javascript_include_tag :defaults %> also didn’t work.

how to solve this?


ruby -v
ruby 1.9.2p290 (2011-07-09) [i386-mingw32]

rails -v
Rails 3.1.1

Am 28.11.2011 06:31, schrieb nibuduomaomao nibuduomaomao:

how to solve this?

Since in rails 3.1.x the asset pipeline compiles all javascript assets
into the application.js by default just including application.js should
be enough.

I did not look into the documentation, but since this behaviour is
default, I dont think that :default exists anymore in 3.1.


You should only need <%= javascript_include_tag “application” %> in the
head to get all the javascript assets for your application.

This links to application.js, the manifest file that includes all other
Javascript listed, including require_tree which includes all files in
assets/javascript folder.

//= require jquery
//= require jquery_ujs
//= require_tree .

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs