[PageOneX] [dev] Javascript Question

pablo rey pablo at basurama.org
Thu Mar 7 10:51:54 EST 2013


it looks like you can associate javascript with certain controllers via
asset pipeline http://guides.rubyonrails.org/asset_pipeline.html

For example, if you generate a ProjectsController, Rails will also add a
> new file atapp/assets/javascripts/projects.js.coffee and another at
> app/assets/stylesheets/projects.css.scss. You should put any JavaScript
> or CSS unique to a controller inside their respective asset files, as
> these files can then be loaded just for these controllers with lines such
> as <%= javascript_include_tag params[:controller] %> or <%=
> stylesheet_link_tag params[:controller] %>.




On Wed, Mar 6, 2013 at 4:32 PM, Edward Platt <elplatt at media.mit.edu> wrote:

> Hi All,
>
> 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?
>
> -Ed
> --
> Edward L. Platt
> Civic Technology Programmer
> MIT Center for Civic Media
> E15-348
> http://civic.mit.edu
> http://elplatt.com
> @EdwardLPlatt <http://twitter.com/edwardlplatt>
>
> _______________________________________________
> Pageonexdev mailing list
> Pageonexdev at mit.edu
> http://mailman.mit.edu/mailman/listinfo/pageonexdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/pageonexdev/attachments/20130307/83fd73e9/attachment.htm


More information about the Pageonexdev mailing list