Bundled CSS and Javascript assets plugin

Plugin details

By bundling and compacting your CSS and Javascript ressources you can significantly reduce your page load times because there’s (potentially) far less HTTP overhead occuring.

This little plugin does all the packaging and compacting for you - on the fly. There’s no need to handle any Rake tasks or even copy stuff manually. Simply install the plugin and you’re ready to use dynamic asset URLs in your templates.

(Yep, this is basiscally the same feature that has been added to Rails 2.0 in the meanwhile. This plugin has a different implementation, works with Rails 1.2.x and adds some extra, optional code compaction.)

Websitehttp://www.artweb-design.de/projects/ruby-on-rails-plugin-bundled-css-and-javascript-assets Repositoryhttp://svn.artweb-design.de/stuff/rails/bundled_assets Author Sven Fuchs Tags Javascript CSS Cache Http Optimization LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install http://svn.artweb-design.de/stuff/rails/bundled_assets

Add the following route to your routes setup:

map.connect 'bundles/:names.:ext', :controller => 'assets_bundle', :action => 'fetch', :ext => /css|js/, :names => /[^.]*/



This will collect the Javascript files common.js and forms.js, combine them into one, optionally compact and then cache the result:

<%= javascript_include_tag 'common,forms' %>


For more information on the usage/options see the plugin's homepage linked above.

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | Back in time (5 older versions) | Last edited by: scott, 12 months ago