I am running Rails 3.1.2 I don''t know if I''m having a Rails problem, an asset problem, or a javascript problem. I find the following is in the source of a rendered page: <script src="/assets/jquery.js?body=1" type="text/javascript"></script> <script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script> <script src="/assets/jquery-ui.js?body=1" type="text/javascript"></script> <script src="/assets/ZeroClipboard.js?body=1" type="text/javascript"></script> <script src="/assets/accordion.js?body=1" type="text/javascript"></script> <script src="/assets/build_batches.js?body=1" type="text/javascript"></script> <script src="/assets/builder.js?body=1" type="text/javascript"></script> <script src="/assets/controls.js?body=1" type="text/javascript"></script> <script src="/assets/dragdrop.js?body=1" type="text/javascript"></script> <script src="/assets/effects.js?body=1" type="text/javascript"></script> <script src="/assets/jquery-scrollTo.js?body=1" type="text/javascript"></script> <script src="/assets/jquery-ui-accordion.js?body=1" type="text/javascript"></script> <script src="/assets/jrails.js?body=1" type="text/javascript"></script> <script src="/assets/prototype.js?body=1" type="text/javascript"></script> <script src="/assets/rails.js?body=1" type="text/javascript"></script> <script src="/assets/row0_in__table_in_tableWrap.js?body=1" type="text/javascript"></script> <script src="/assets/scriptaculous.js?body=1" type="text/javascript"></script> <script src="/assets/slider.js?body=1" type="text/javascript"></script> <script src="/assets/sound.js?body=1" type="text/javascript"></script> <script src="/assets/swfobject.js?body=1" type="text/javascript"></script> <script src="/assets/unittest.js?body=1" type="text/javascript"></script> <script src="/assets/application.js?body=1" type="text/javascript"></script> <script src="/assets/effects.js?body=1" type="text/javascript"></script> <script src="/assets/controls.js?body=1" type="text/javascript"></script> <script src="/assets/jquery.js?body=1" type="text/javascript"></script> <script src="/assets/row0_in__table_in_tableWrap.js?body=1" type="text/javascript"></script> <script src="/assets/common/shnHelpers.js?body=1" type="text/javascript"></script> <script src="/assets/common/dotimeout.js?body=1" type="text/javascript"></script> As you can see, the scripts (Why aren''t they inlined?) are in partial alphabetical order. This is not the order I have my javascript_include_tags in and this is causing problems. Can someone tell me what I''m doing wrong and/or suggest a solution? Ralph Shnelvar -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
They are not compressed because you have "config.assets.debug = true" Kind of strange though that they are in the wrong order. What does your javascript_include_tag look like, and what do the files it''s calling look like? -- 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/-/nKGSORCeqwkJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><title>Re: [Rails] Re: Am I having an asset problem?</title> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- body { margin: 5px 5px 5px 5px; background-color: #ffffff; } /* ========== Text Styles ========== */ hr { color: #000000} body, table /* Normal text */ { font-size: 9pt; font-family: ''Courier New''; font-style: normal; font-weight: normal; color: #000000; text-decoration: none; } span.rvts1 /* Heading */ { font-size: 10pt; font-family: ''Arial''; font-weight: bold; color: #0000ff; } span.rvts2 /* Subheading */ { font-size: 10pt; font-family: ''Arial''; font-weight: bold; color: #000080; } span.rvts3 /* Keywords */ { font-size: 10pt; font-family: ''Arial''; font-style: italic; color: #800000; } a.rvts4, span.rvts4 /* Jump 1 */ { font-size: 10pt; font-family: ''Arial''; color: #008000; text-decoration: underline; } a.rvts5, span.rvts5 /* Jump 2 */ { font-size: 10pt; font-family: ''Arial''; color: #008000; text-decoration: underline; } span.rvts6 { font-size: 8pt; font-family: ''segoe ui''; } a.rvts7, span.rvts7 { font-size: 8pt; font-family: ''segoe ui''; color: #0000ff; background-color: #ffffff; text-decoration: underline; } span.rvts8 { font-size: 8pt; font-family: ''arial''; font-style: italic; color: #c0c0c0; } a.rvts9, span.rvts9 { font-size: 8pt; font-family: ''arial''; color: #0000ff; text-decoration: underline; } span.rvts10 { font-size: 8pt; } /* ========== Para Styles ========== */ p,ul,ol /* Paragraph Style */ { text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; } .rvps1 /* Centered */ { text-align: center; } --></style> </head> <body> <p>Thursday, December 29, 2011, 12:32:32 PM, you wrote:</p> <p><br></p> <div><table border=0 cellpadding=1 cellspacing=2 style="background-color: #ffffff;"> <tr valign=top> <td width=2 style="background-color: #0000ff;"><br> </td> <td width=1467> <p><span class=rvts6>They are not compressed because you have "config.assets.debug = true"</span></p> <p><br></p> <p><span class=rvts6>Kind of strange though that they are in the wrong order. What does your javascript_include_tag look like, and what do the files it''s calling look like? </span></p> </td> </tr> </table> </div> <p><br></p> <p><a class=rvts9 href="mailto:ralphs-bVGy8FV858MAvxtiuMwx3w@public.gmane.org"><br></a></p> <p><a class=rvts9 href="mailto:ralphs-bVGy8FV858MAvxtiuMwx3w@public.gmane.org"><br></a></p> <p><a class=rvts9 href="mailto:ralphs-bVGy8FV858MAvxtiuMwx3w@public.gmane.org">Here</a><span class=rvts10> is part of the relevant code in application.html.haml</span></p> <p><br></p> <p>%html{ "xml:lang" => i18n_locale, :lang => i18n_locale, :xmlns => "http://www.w3.org/1999/xhtml" }</p> <p> %head</p> <p> %title</p> <p> = h(yield(:title) || shnI18n.t("meta title"))</p> <p> %meta{ :name => "Keywords", :content => "UltraDedup, VM, VMWare, deduplication, compression, deduplicate, Deduplicates , backups, backup, back up, free, scripting, video, tutorials, flash" }</p> <p> %meta{ :content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type" }</p> <p> %meta{ "http-equiv" => "X-UA-Compatible", "content" => "IE=edge" }</p> <p> - meta_description_content = h(yield(:meta) || shnI18n.t( "meta description"))</p> <p> %meta{ ''name'' => "description", "content" => meta_description_content }</p> <p> - meta_flashMovie = h(yield(:meta_flashMovie) || "")</p> <p> - unless meta_flashMovie.to_s == ""</p> <p> - puts "#{__FILE__} @ #{__LINE__}"</p> <p> - puts meta_flashMovie.class</p> <p> - puts meta_flashMovie</p> <p> <meta #{meta_flashMovie} /></p> <p> = stylesheet_link_tag ''application''</p> <p> - puts "#{__FILE__} @ #{__LINE__}"</p> <p> = javascript_include_tag ''application.js''</p> <p> = javascript_include_tag ''effects.js''</p> <p> = javascript_include_tag ''controls.js''</p> <p> = javascript_include_tag ''jquery.js''</p> <p> = javascript_include_tag ''row0_in__table_in_tableWrap.js''</p> <p> = javascript_include_tag ''shnHelpers.js''</p> <p> = javascript_include_tag ''dotimeout.js''</p> <p> %link{''rel'' => "shortcut icon", ''href'' => "/images/UltraDedup-icon-003---16x16.ico", ''type'' => "image/x-icon"}</p> <p> = yield(:head)</p> <p> %body</p> <p><br></p> <p><br></p> <p>Note that effects.js appears before controls.js in the code above.</p> <p><br></p> <p>What is doubly strange is tat sound.js and unittest.js was never explicitly included in a javascript_include_tag statement. I think the assets manager is taking all the .js file it finds and includes them implicitly. </p> <p><br></p> <p><br></p> <p><br></p> <p>To repeat, the rendered html shows controls.js appears before effects.js.</p> <p><br></p> <p><script src="/assets/jquery.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/jquery-ui.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/ZeroClipboard.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/accordion.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/build_batches.js?body=1" type="text/javascript"></script></p> <p><br></p> <p><script src="/assets/builder.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/controls.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/dragdrop.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/effects.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/jquery-scrollTo.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/jquery-ui-accordion.js?body=1" type="text/javascript"></script></p> <p><br></p> <p><script src="/assets/jrails.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/prototype.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/rails.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/row0_in__table_in_tableWrap.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/scriptaculous.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/slider.js?body=1" type="text/javascript"></script></p> <p><br></p> <p><script src="/assets/sound.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/swfobject.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/unittest.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/application.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/effects.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/controls.js?body=1" type="text/javascript"></script></p> <p><br></p> <p><script src="/assets/jquery.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/row0_in__table_in_tableWrap.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/common/shnHelpers.js?body=1" type="text/javascript"></script></p> <p><script src="/assets/common/dotimeout.js?body=1" type="text/javascript"></script></p> </body></html> <p></p> -- <br /> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.<br /> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org<br /> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org<br /> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.<br />
On Dec 29, 2011, at 3:36 PM, Ralph Shnelvar wrote:> Thursday, December 29, 2011, 12:32:32 PM, you wrote: > > > They are not compressed because you have "config.assets.debug = true" > > Kind of strange though that they are in the wrong order. What does your javascript_include_tag look like, and what do the files it''s calling look like? > > > > Here is part of the relevant code in application.html.haml > > %html{ "xml:lang" => i18n_locale, :lang => i18n_locale, :xmlns => "http://www.w3.org/1999/xhtml" } > %head > %title > = h(yield(:title) || shnI18n.t("meta title")) > %meta{ :name => "Keywords", :content => "UltraDedup, VM, VMWare, deduplication, compression, deduplicate, Deduplicates , backups, backup, back up, free, scripting, video, tutorials, flash" } > %meta{ :content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type" } > %meta{ "http-equiv" => "X-UA-Compatible", "content" => "IE=edge" } > - meta_description_content = h(yield(:meta) || shnI18n.t( "meta description")) > %meta{ ''name'' => "description", "content" => meta_description_content } > - meta_flashMovie = h(yield(:meta_flashMovie) || "") > - unless meta_flashMovie.to_s == "" > - puts "#{__FILE__} @ #{__LINE__}" > - puts meta_flashMovie.class > - puts meta_flashMovie > <meta #{meta_flashMovie} /> > = stylesheet_link_tag ''application'' > - puts "#{__FILE__} @ #{__LINE__}" > = javascript_include_tag ''application.js'' > = javascript_include_tag ''effects.js'' > = javascript_include_tag ''controls.js'' > = javascript_include_tag ''jquery.js'' > = javascript_include_tag ''row0_in__table_in_tableWrap.js'' > = javascript_include_tag ''shnHelpers.js'' > = javascript_include_tag ''dotimeout.js'' > %link{''rel'' => "shortcut icon", ''href'' => "/images/UltraDedup-icon-003---16x16.ico", ''type'' => "image/x-icon"} > = yield(:head) > %body > > > Note that effects.js appears before controls.js in the code above. > > What is doubly strange is tat sound.js and unittest.js was never explicitly included in a javascript_include_tag statement. I think the assets manager is taking all the .js file it finds and includes them implicitly. > > > > To repeat, the rendered html shows controls.js appears before effects.js. > > <script src="/assets/jquery.js?body=1" type="text/javascript"></script> > <script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script> > <script src="/assets/jquery-ui.js?body=1" type="text/javascript"></script> > <script src="/assets/ZeroClipboard.js?body=1" type="text/javascript"></script> > <script src="/assets/accordion.js?body=1" type="text/javascript"></script> > <script src="/assets/build_batches.js?body=1" type="text/javascript"></script> > > <script src="/assets/builder.js?body=1" type="text/javascript"></script> > <script src="/assets/controls.js?body=1" type="text/javascript"></script> > <script src="/assets/dragdrop.js?body=1" type="text/javascript"></script> > <script src="/assets/effects.js?body=1" type="text/javascript"></script> > <script src="/assets/jquery-scrollTo.js?body=1" type="text/javascript"></script> > <script src="/assets/jquery-ui-accordion.js?body=1" type="text/javascript"></script> > > <script src="/assets/jrails.js?body=1" type="text/javascript"></script> > <script src="/assets/prototype.js?body=1" type="text/javascript"></script> > <script src="/assets/rails.js?body=1" type="text/javascript"></script> > <script src="/assets/row0_in__table_in_tableWrap.js?body=1" type="text/javascript"></script> > <script src="/assets/scriptaculous.js?body=1" type="text/javascript"></script> > <script src="/assets/slider.js?body=1" type="text/javascript"></script> > > <script src="/assets/sound.js?body=1" type="text/javascript"></script> > <script src="/assets/swfobject.js?body=1" type="text/javascript"></script> > <script src="/assets/unittest.js?body=1" type="text/javascript"></script> > <script src="/assets/application.js?body=1" type="text/javascript"></script> > <script src="/assets/effects.js?body=1" type="text/javascript"></script> > <script src="/assets/controls.js?body=1" type="text/javascript"></script> > > <script src="/assets/jquery.js?body=1" type="text/javascript"></script> > <script src="/assets/row0_in__table_in_tableWrap.js?body=1" type="text/javascript"></script> > <script src="/assets/common/shnHelpers.js?body=1" type="text/javascript"></script> > <script src="/assets/common/dotimeout.js?body=1" type="text/javascript"></script>---- I gather that including ''application.js'' in your template is what causes all the files in app/assets/javascripts to be loaded in alphabetic order - at least, that was my conclusion but I think that was with Rails 3.1.1 and now I am on 3.1.3 and it seems to do the same... also the css files in app/assets/stylesheets which forced me to rename my main css file to zlayout.css I rather like the ability to have snippets of javascript and css in separate files while in development mode as that allows portability but the alphabetic loading threw me for a while and I finally figured out that at least the order is predictable (which is important with css) It would seem if you want to manhandle the load order of scripts in assets then you probably should not include application.js and include those you specifically want in your layout but then you are going to have make manual adjustments when it comes to deploying (as opposed to simply executing ''bundle exec rake assets:precompile'') Craig -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
the problem is that you are using require_tree in your application.js file. Instead, require the files individually like so: // This is a manifest file that''ll be compiled into including all the files listed below. // Add new JavaScript/Coffee code in separate files in this directory and they''ll automatically // 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 jquery_ujs //= require external/json2 //= require external/jquery.url //= requrie external/jquery.mousewheel //= require external/jquery.jscrollpane ... On Thu, Dec 29, 2011 at 3:26 PM, Craig White <craig.white-wmL3h9Ogt9DQT0dZR+AlfA@public.gmane.org> wrote:> > On Dec 29, 2011, at 3:36 PM, Ralph Shnelvar wrote: > > > Thursday, December 29, 2011, 12:32:32 PM, you wrote: > > > > > > They are not compressed because you have "config.assets.debug = true" > > > > Kind of strange though that they are in the wrong order. What does your > javascript_include_tag look like, and what do the files it''s calling look > like? > > > > > > > > Here is part of the relevant code in application.html.haml > > > > %html{ "xml:lang" => i18n_locale, :lang => i18n_locale, :xmlns => " > http://www.w3.org/1999/xhtml" } > > %head > > %title > > = h(yield(:title) || shnI18n.t("meta title")) > > %meta{ :name => "Keywords", :content => "UltraDedup, VM, VMWare, > deduplication, compression, deduplicate, Deduplicates , backups, backup, > back up, free, scripting, video, tutorials, flash" } > > %meta{ :content => "text/html; charset=UTF-8", "http-equiv" => > "Content-Type" } > > %meta{ "http-equiv" => "X-UA-Compatible", "content" => "IE=edge" } > > - meta_description_content = h(yield(:meta) || shnI18n.t( "meta > description")) > > %meta{ ''name'' => "description", "content" => > meta_description_content } > > - meta_flashMovie = h(yield(:meta_flashMovie) || "") > > - unless meta_flashMovie.to_s == "" > > - puts "#{__FILE__} @ #{__LINE__}" > > - puts meta_flashMovie.class > > - puts meta_flashMovie > > <meta #{meta_flashMovie} /> > > = stylesheet_link_tag ''application'' > > - puts "#{__FILE__} @ #{__LINE__}" > > = javascript_include_tag ''application.js'' > > = javascript_include_tag ''effects.js'' > > = javascript_include_tag ''controls.js'' > > = javascript_include_tag ''jquery.js'' > > = javascript_include_tag ''row0_in__table_in_tableWrap.js'' > > = javascript_include_tag ''shnHelpers.js'' > > = javascript_include_tag ''dotimeout.js'' > > %link{''rel'' => "shortcut icon", ''href'' => > "/images/UltraDedup-icon-003---16x16.ico", ''type'' => "image/x-icon"} > > = yield(:head) > > %body > > > > > > Note that effects.js appears before controls.js in the code above. > > > > What is doubly strange is tat sound.js and unittest.js was never > explicitly included in a javascript_include_tag statement. I think the > assets manager is taking all the .js file it finds and includes them > implicitly. > > > > > > > > To repeat, the rendered html shows controls.js appears before effects.js. > > > > <script src="/assets/jquery.js?body=1" type="text/javascript"></script> > > <script src="/assets/jquery_ujs.js?body=1" > type="text/javascript"></script> > > <script src="/assets/jquery-ui.js?body=1" > type="text/javascript"></script> > > <script src="/assets/ZeroClipboard.js?body=1" > type="text/javascript"></script> > > <script src="/assets/accordion.js?body=1" > type="text/javascript"></script> > > <script src="/assets/build_batches.js?body=1" > type="text/javascript"></script> > > > > <script src="/assets/builder.js?body=1" type="text/javascript"></script> > > <script src="/assets/controls.js?body=1" type="text/javascript"></script> > > <script src="/assets/dragdrop.js?body=1" type="text/javascript"></script> > > <script src="/assets/effects.js?body=1" type="text/javascript"></script> > > <script src="/assets/jquery-scrollTo.js?body=1" > type="text/javascript"></script> > > <script src="/assets/jquery-ui-accordion.js?body=1" > type="text/javascript"></script> > > > > <script src="/assets/jrails.js?body=1" type="text/javascript"></script> > > <script src="/assets/prototype.js?body=1" > type="text/javascript"></script> > > <script src="/assets/rails.js?body=1" type="text/javascript"></script> > > <script src="/assets/row0_in__table_in_tableWrap.js?body=1" > type="text/javascript"></script> > > <script src="/assets/scriptaculous.js?body=1" > type="text/javascript"></script> > > <script src="/assets/slider.js?body=1" type="text/javascript"></script> > > > > <script src="/assets/sound.js?body=1" type="text/javascript"></script> > > <script src="/assets/swfobject.js?body=1" > type="text/javascript"></script> > > <script src="/assets/unittest.js?body=1" type="text/javascript"></script> > > <script src="/assets/application.js?body=1" > type="text/javascript"></script> > > <script src="/assets/effects.js?body=1" type="text/javascript"></script> > > <script src="/assets/controls.js?body=1" type="text/javascript"></script> > > > > <script src="/assets/jquery.js?body=1" type="text/javascript"></script> > > <script src="/assets/row0_in__table_in_tableWrap.js?body=1" > type="text/javascript"></script> > > <script src="/assets/common/shnHelpers.js?body=1" > type="text/javascript"></script> > > <script src="/assets/common/dotimeout.js?body=1" > type="text/javascript"></script> > ---- > I gather that including ''application.js'' in your template is what causes > all the files in app/assets/javascripts to be loaded in alphabetic order - > at least, that was my conclusion but I think that was with Rails 3.1.1 and > now I am on 3.1.3 and it seems to do the same... also the css files in > app/assets/stylesheets which forced me to rename my main css file to > zlayout.css > > I rather like the ability to have snippets of javascript and css in > separate files while in development mode as that allows portability but the > alphabetic loading threw me for a while and I finally figured out that at > least the order is predictable (which is important with css) > > It would seem if you want to manhandle the load order of scripts in assets > then you probably should not include application.js and include those you > specifically want in your layout but then you are going to have make manual > adjustments when it comes to deploying (as opposed to simply executing > ''bundle exec rake assets:precompile'') > > Craig > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thursday, December 29, 2011, 4:26:30 PM, you wrote: CW> On Dec 29, 2011, at 3:36 PM, Ralph Shnelvar wrote:>> Thursday, December 29, 2011, 12:32:32 PM, you wrote: >> >> >> They are not compressed because you have "config.assets.debug = true" >> >> Kind of strange though that they are in the wrong order. What does your javascript_include_tag look like, and what do the files it''s calling look like? >> >> >> >> Here is part of the relevant code in application.html.haml >> >> %html{ "xml:lang" => i18n_locale, :lang => i18n_locale, :xmlns => "http://www.w3.org/1999/xhtml" } >> %head >> %title >> = h(yield(:title) || shnI18n.t("meta title")) >> %meta{ :name => "Keywords", :content => "UltraDedup, VM, VMWare, deduplication, compression, deduplicate, Deduplicates , backups, backup, back up, free, scripting, video, tutorials, flash" } >> %meta{ :content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type" } >> %meta{ "http-equiv" => "X-UA-Compatible", "content" => "IE=edge" } >> - meta_description_content = h(yield(:meta) || shnI18n.t( "meta description")) >> %meta{ ''name'' => "description", "content" => meta_description_content } >> - meta_flashMovie = h(yield(:meta_flashMovie) || "") >> - unless meta_flashMovie.to_s == "" >> - puts "#{__FILE__} @ #{__LINE__}" >> - puts meta_flashMovie.class >> - puts meta_flashMovie >> <meta #{meta_flashMovie} /> >> = stylesheet_link_tag ''application'' >> - puts "#{__FILE__} @ #{__LINE__}" >> = javascript_include_tag ''application.js'' >> = javascript_include_tag ''effects.js'' >> = javascript_include_tag ''controls.js'' >> = javascript_include_tag ''jquery.js'' >> = javascript_include_tag ''row0_in__table_in_tableWrap.js'' >> = javascript_include_tag ''shnHelpers.js'' >> = javascript_include_tag ''dotimeout.js'' >> %link{''rel'' => "shortcut icon", ''href'' => "/images/UltraDedup-icon-003---16x16.ico", ''type'' => "image/x-icon"} >> = yield(:head) >> %body >> >> >> Note that effects.js appears before controls.js in the code above. >> >> What is doubly strange is tat sound.js and unittest.js was never explicitly included in a javascript_include_tag statement. I think the assets manager is taking all the .js file it finds and includes them implicitly. >> >> >> >> To repeat, the rendered html shows controls.js appears before effects.js. >> >> <script src="/assets/jquery.js?body=1" type="text/javascript"></script> >> <script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script> >> <script src="/assets/jquery-ui.js?body=1" type="text/javascript"></script> >> <script src="/assets/ZeroClipboard.js?body=1" type="text/javascript"></script> >> <script src="/assets/accordion.js?body=1" type="text/javascript"></script> >> <script src="/assets/build_batches.js?body=1" type="text/javascript"></script> >> >> <script src="/assets/builder.js?body=1" type="text/javascript"></script> >> <script src="/assets/controls.js?body=1" type="text/javascript"></script> >> <script src="/assets/dragdrop.js?body=1" type="text/javascript"></script> >> <script src="/assets/effects.js?body=1" type="text/javascript"></script> >> <script src="/assets/jquery-scrollTo.js?body=1" type="text/javascript"></script> >> <script src="/assets/jquery-ui-accordion.js?body=1" type="text/javascript"></script> >> >> <script src="/assets/jrails.js?body=1" type="text/javascript"></script> >> <script src="/assets/prototype.js?body=1" type="text/javascript"></script> >> <script src="/assets/rails.js?body=1" type="text/javascript"></script> >> <script src="/assets/row0_in__table_in_tableWrap.js?body=1" type="text/javascript"></script> >> <script src="/assets/scriptaculous.js?body=1" type="text/javascript"></script> >> <script src="/assets/slider.js?body=1" type="text/javascript"></script> >> >> <script src="/assets/sound.js?body=1" type="text/javascript"></script> >> <script src="/assets/swfobject.js?body=1" type="text/javascript"></script> >> <script src="/assets/unittest.js?body=1" type="text/javascript"></script> >> <script src="/assets/application.js?body=1" type="text/javascript"></script> >> <script src="/assets/effects.js?body=1" type="text/javascript"></script> >> <script src="/assets/controls.js?body=1" type="text/javascript"></script> >> >> <script src="/assets/jquery.js?body=1" type="text/javascript"></script> >> <script src="/assets/row0_in__table_in_tableWrap.js?body=1" type="text/javascript"></script> >> <script src="/assets/common/shnHelpers.js?body=1" type="text/javascript"></script> >> <script src="/assets/common/dotimeout.js?body=1" type="text/javascript"></script>CW> ---- CW> I gather that including ''application.js'' in your template is what causes all the files in app/assets/javascripts to be loaded in alphabetic order - at least, that was my conclusion but I think CW> that was with Rails 3.1.1 and now I am on 3.1.3 and it seems to do the same... also the css files in app/assets/stylesheets which forced me to rename my main css file to zlayout.css CW> I rather like the ability to have snippets of javascript and css in separate files while in development mode as that allows portability but the alphabetic loading threw me for a while and I finally figured out that at least the order is predictable (which is important with css) CW> It would seem if you want to manhandle the load order of scripts in assets then you probably should not include application.js and include those you specifically want in your layout but then you CW> are going to have make manual adjustments when it comes to deploying (as opposed to simply executing ''bundle exec rake assets:precompile'') CW> Craig Thank you. Now that I know someone else is seeing this crazy behavior, I''ll dig into the code and see if I can turn it off and have it act reasonably. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
On Thu, 2011-12-29 at 18:30 -0700, Ralph Shnelvar wrote:> Thursday, December 29, 2011, 4:26:30 PM, you wrote:> CW> ---- > CW> I gather that including ''application.js'' in your template is what causes all the files in app/assets/javascripts to be loaded in alphabetic order - at least, that was my conclusion but I think > CW> that was with Rails 3.1.1 and now I am on 3.1.3 and it seems to do the same... also the css files in app/assets/stylesheets which forced me to rename my main css file to zlayout.css > > CW> I rather like the ability to have snippets of javascript and css in separate files while in development mode as that allows portability but the alphabetic loading threw me for a while and I finally figured out that at least the order is predictable (which is important with css) > > CW> It would seem if you want to manhandle the load order of scripts in assets then you probably should not include application.js and include those you specifically want in your layout but then you > CW> are going to have make manual adjustments when it comes to deploying (as opposed to simply executing ''bundle exec rake assets:precompile'') > > CW> Craig > > Thank you. > > Now that I know someone else is seeing this crazy behavior, I''ll dig into the code and see if I can turn it off and have it act reasonably.---- Martin explained it... In app/assets/javascripts/application.js, the line... //=require_tree causes it to auto-load the other files in the same directory. That said, I would suggest that you learn to swim with the tide and make it work to your advantage rather than override the default behavior. Craig -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
Thursday, December 29, 2011, 8:54:05 PM, you wrote: CW> On Thu, 2011-12-29 at 18:30 -0700, Ralph Shnelvar wrote:>> Thursday, December 29, 2011, 4:26:30 PM, you wrote:>> CW> ---- >> CW> I gather that including ''application.js'' in your template is what causes all the files in app/assets/javascripts to be loaded in alphabetic order - at least, that was my conclusion but I think >> CW> that was with Rails 3.1.1 and now I am on 3.1.3 and it seems to do the same... also the css files in app/assets/stylesheets which forced me to rename my main css file to zlayout.css >> >> CW> I rather like the ability to have snippets of javascript and css in separate files while in development mode as that allows portability but the alphabetic loading threw me for a while and I finally figured out that at least the order is predictable (which is important with css) >> >> CW> It would seem if you want to manhandle the load order of scripts in assets then you probably should not include application.js and include those you specifically want in your layout but then you >> CW> are going to have make manual adjustments when it comes to deploying (as opposed to simply executing ''bundle exec rake assets:precompile'') >> >> CW> Craig >> >> Thank you. >> >> Now that I know someone else is seeing this crazy behavior, I''ll dig into the code and see if I can turn it off and have it act reasonably.CW> ---- CW> Martin explained it... CW> In app/assets/javascripts/application.js, the line... CW> //=require_tree CW> causes it to auto-load the other files in the same directory. CW> That said, I would suggest that you learn to swim with the tide and make CW> it work to your advantage rather than override the default behavior. Well, I would have tracked the code and found that something was parsing COMMENTS. It may be just me but that is totally unexpected behavior. I can understand parsing comments to produce documentation .... but I briefly looked at those supposed COMMENTS and thought that I was reading COMMENTS. To me, putting functionality into COMMENTS is just an awful design. Anyway, thank you to all who pointed this all out to me. Ralph Shnelvar -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.