Rails Asset Pipeline loads all files -


i have multiple files in app/assets/javscripts folder, application.js.erb, page.js.erb, sections.js.erb & scraped.js.erb.

rails loads them in layout <%= javascript_include_tag "application" %> in application.html.erb layout. called pagescontroller.

i not want scraped.js.erb loaded @ & sections.js.erb loaded sectionscontroller.

from understanding (after reading http://guides.rubyonrails.org/asset_pipeline.html) that's how asset pipeline worked. if called pagescontroller load application.js.erb & page.js.erb that's not case.

am doing wrong? explain me how asset pipeline works? , how can use select assets rather of them?

check manifest file, in assets/javascript got file application.js, contains //= require_tree . include during compilation files of directory tree.

if want exclude files can either require files 1 one: // require my_file, either create sub directories in javascript directory , use //= require_directory my_directory

read more http://guides.rubyonrails.org/asset_pipeline.html


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -