Wednesday, October 17, 2012

[Rails] Not all javascript files for asset pipeline:

Rails 3.1.3

Not all javascript files are necessary for every page of app.
If I put all JavaScript files in app/assets/javascripts/ , all of them
are compiled and read in every page. I believe this is a waste of
memory space and CPU load.

Is there anyway to avoid it?

I suppose we can put some javascript files in lib/assets/javascripts/
directory, and

<script type="text/javascript"
src="/lib/assets/javascripts/geodesic.js"></script>

in the page that requires the particular file.

Does this work? Because I cannot figure out the route required for this.

soichi

--
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 https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate