New to Rails 3? Check out the Ruby on Rails 3 Tutorial book and screencast.

A book and screencast series showing you how to develop and deploy industrial-strength Rails apps in a direct, step by step way. The screencast series includes 12 lessons over more than 15 hours! Get the best "over the shoulder" experience of following what a top Rails 3 developer does when building an app today. Click here to learn more.

Jammit: Industrial Strength Asset Packaging for Rails Apps

In Plugins, Tools

jammit.pngEarlier this year on Ruby Inside, we wrote about Sprockets - a Ruby library from 37signals that could take the various JavaScript files used in your project and compress them down on the fly into smaller portions to be more easily sent over the wire. Now, however, say hello to Jammit, an "industrial strength" asset packaging library for Rails that handles not only JavaScript, but also CSS and inline images.

Asset packaging is nothing new, but Jammit has an unusual feature in that it can take small images used on your site and embed them into your CSS file using the data-uri mechanism. The benefit is that you reduce the number of files that need to be downloaded to render a single page - significant as most browsers have a limit to the number of files they can retrieve simultaneously from the same host.

jammit_diagram.jpg

Jammit has a well designed GitHub hosted homepage that goes into how to install it (just install a gem, add the reference to environment.rb, and add a route into config/routes.rb), set it up to take note of your assets (all done via a YAML file), and get things running in your views (add some helpers to your main layout), so refer to that for further details.

caliper-logo.png[ad] Find duplication, code smells, complex code and more in your Ruby code with Caliper! The metrics are free and setup takes just one click. Get started!

Post to Twitter Tweet This Post

Vaguely Related Posts (Usually)

2 Comment Responses to “Jammit: Industrial Strength Asset Packaging for Rails Apps”

  1. #1
    dan/blog » Blog Archive » Pack it up with Jammit Says:

    [...] A rails package I just came across does the same thing - check out http://documentcloud.github.com/jammit/ mentioned in Rails Inside. [...]

  2. #2
    Peter Cooper Says:

    xyz testing

Leave a Reply