You are here: Browse Railsplugins Asset Tag Extensions
Extensions to the standard asset tag helpers available in Rails to help create manageable stylesheets and javascripts.
AssetTagExtensions provides the following convenience methods:
AssetTagExtensions will extend the standard helpers for including javascript and stylesheet files to have the following behavior:
1. Work unmodified, can be dropped into existing projects 2. Check for the existense of, and include, controller.(js|css) and controller/action.(js|css) 3. Include additional js and css files specified in views with additional_(js|css)
The controller and action specific assets was borrowed from the excellent Styler and Javascripter plugins. The additional_(js|css) convenience methods are from my own experience in having modular assets. The swf_tag just seemed to be a natural fit as another extension.
This allows you to easily modularize your javascript and stylesheets into an almost endless amount of configurations.
In your layout:
<%= javascript_include_tag :default %>
In your home/index.rhtml:
<%= additional_js ‘ads’ %>
Output:
NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly