<div dir="ltr"><br><div style>it looks like you can associate javascript with certain controllers via asset pipeline <a href="http://guides.rubyonrails.org/asset_pipeline.html">http://guides.rubyonrails.org/asset_pipeline.html</a></div>
<div style><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="color:rgb(51,51,51);font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:21px">For example, if you generate a </span><tt style="margin:0px;padding:0px;border:0px;outline:0px;font-size:14px;font-family:'Anonymous Pro',Inconsolata,Menlo,Consolas,'Bitstream Vera Sans Mono','Courier New',monospace;line-height:21px;color:rgb(51,51,51)">ProjectsController</tt><span style="color:rgb(51,51,51);font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:21px">, Rails will also add a new file at</span><tt style="margin:0px;padding:0px;border:0px;outline:0px;font-size:14px;font-family:'Anonymous Pro',Inconsolata,Menlo,Consolas,'Bitstream Vera Sans Mono','Courier New',monospace;line-height:21px;color:rgb(51,51,51)">app/assets/javascripts/projects.js.coffee</tt><span style="color:rgb(51,51,51);font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:21px"> and another at</span><tt style="margin:0px;padding:0px;border:0px;outline:0px;font-size:14px;font-family:'Anonymous Pro',Inconsolata,Menlo,Consolas,'Bitstream Vera Sans Mono','Courier New',monospace;line-height:21px;color:rgb(51,51,51)">app/assets/stylesheets/projects.css.scss</tt><span style="color:rgb(51,51,51);font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:21px">. You should put any JavaScript or </span><span class="" style="margin:0px;padding:0px;border:0px;outline:0px;font-size:14px;color:rgb(51,51,51);font-family:Helvetica,Arial,sans-serif;line-height:21px">CSS</span><span style="color:rgb(51,51,51);font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:21px"> unique to a controller inside their respective asset files, as these files can then be loaded just for these controllers with lines such as </span><tt style="margin:0px;padding:0px;border:0px;outline:0px;font-size:14px;font-family:'Anonymous Pro',Inconsolata,Menlo,Consolas,'Bitstream Vera Sans Mono','Courier New',monospace;line-height:21px;color:rgb(51,51,51)"><%= javascript_include_tag params[:controller] %></tt><span style="color:rgb(51,51,51);font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:21px"> or </span><tt style="margin:0px;padding:0px;border:0px;outline:0px;font-size:14px;font-family:'Anonymous Pro',Inconsolata,Menlo,Consolas,'Bitstream Vera Sans Mono','Courier New',monospace;line-height:21px;color:rgb(51,51,51)"><%= stylesheet_link_tag params[:controller] %></tt><span style="color:rgb(51,51,51);font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:21px">.</span></blockquote>
<div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 6, 2013 at 4:32 PM, Edward Platt <span dir="ltr"><<a href="mailto:elplatt@media.mit.edu" target="_blank">elplatt@media.mit.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi All,<div><br></div><div>Does anyone knows whether all of the files in assets/javascript/ are loaded for each page? Or is there a way to configure javascript to be included on specific pages?<br clear="all">
<div><br></div><div>-Ed</div><span class="HOEnZb"><font color="#888888">-- <br><div>Edward L. Platt<br></div><div>Civic Technology Programmer</div><div>MIT Center for Civic Media</div><div>E15-348</div><div><a href="http://civic.mit.edu" target="_blank">http://civic.mit.edu</a></div>
<div><a href="http://elplatt.com" target="_blank">http://elplatt.com</a></div><div><a href="http://twitter.com/edwardlplatt" target="_blank">@EdwardLPlatt</a></div>
</font></span></div></div>
<br>_______________________________________________<br>
Pageonexdev mailing list<br>
<a href="mailto:Pageonexdev@mit.edu">Pageonexdev@mit.edu</a><br>
<a href="http://mailman.mit.edu/mailman/listinfo/pageonexdev" target="_blank">http://mailman.mit.edu/mailman/listinfo/pageonexdev</a><br>
<br></blockquote></div><br></div></div>