Ruby on Rails Thursday, December 29, 2011

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@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.

No comments:

Post a Comment