in app\views\layouts\application.html.erb
when i write
<%= javascript_include_tag :defaults %> ,
i get
<script src="/assets/defaults.js" type="text/javascript"></script>
at source file.

<%= javascript_include_tag "application" %> gets
<script src="/assets/application.js?body=1"
type="text/javascript"></script>.

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

how to solve this?

thanks.

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

rails -v
Rails 3.1.1

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Norbert Melzer at Nov 28, 2011 at 7:34 am

    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.

    HTH
    Norbert
  • Nverba at Nov 28, 2011 at 1:24 pm
    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 the
    assets/javascript folder.

    application.js
    //= require jquery
    //= require jquery_ujs
    //= require_tree .

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/Bsz_sVNKakMJ.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedNov 28, '11 at 5:31a
activeNov 28, '11 at 1:24p
posts3
users3
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2021 Grokbase