i encounter double includes in development mode when i use config.assets.debug = true, its ok if config.assets.debug = false
i renamed application.js to lomography.js
config.assets.debug = true
// This is a manifest file that'll be compiled into including all the files listed below.
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//= require mootools
//= require mootools_ujs
//= require username
in my understanding lomography.js shouldn't be included at all in development mode.
i encountered the issue when i used link_to with :remote => true and a confirm message, because the confirm message was asked twice.
what else do you need?
I can't reproduct this problem.
Please tell us some informations.
1: your environment
$ ruby -v / rails -v
3: config.assets.precompile setting
ex) config.assets.precompile += %w( search.js )
4: other config.assets settings
thats strange, i provide you with some more information
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.1.0]
<link href="<%= asset_path('icon.png') %>" media="screen" rel="shortcut icon" type="image/x-icon" />
<%= stylesheet_link_tag "lomography" %>
<%= csrf_meta_tag %>
this is only in my production.rb, not in development.rb!
config.assets.precompile += %w( lomography.js lomography.css backend.css)
i renamed the application.js to lomography.js and i pasted it before
Does your public/assets directory contain a lomography.js file? If so then I bet you are serving up the static public/assets lomography.js file with all of the compiled js and then your app also serves up all of the "requires" within the lomography.js because debug is on. You can get around this by either clearing out your public/assets directory or by setting config.assets.prefix to "/devassets" in your development.rb environment file.
it happens also when my public/assets is empty. also i see the log message "Served asset /lomography.js - 304 Not Modified (0ms)" it its not coming from my static asset folder.
this means, the include comes somewhere from rails
According to sprockets's source,
if debug is true, it seems that Sprockets server have returned js in 2 way.
1: only lompgrapy.js when url has body=1
2: concated js when url has not body=1 (even if debug is true)
i cant reproduce it neither. i don't know what i changed.
i made a new project and copied all the files to the new project and the link_to_remote is only called once.
i will close it now, since it seems only to happen in my project.
Drop remaining script/plugin sources references
Signed-off-by: Santiago Pastorino <firstname.lastname@example.org>