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

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -