robdoan
robdoan

Reputation: 59

How to compress css files and javascript file in Ruby on rails

I want to compress css files and javascript files in my project. Is there any plugin to do that? :">

Upvotes: 4

Views: 2835

Answers (3)

Sandro L
Sandro L

Reputation: 1150

Rails 3.1 will do this automagically, as Ryan Bates shows in his Rails-3.1 Overview.

Upvotes: 1

clyfe
clyfe

Reputation: 23770

I used bundle-fu, worked great.

  • compresses both css and javascript
  • has no external dependencies
  • is around for a long time (proven)
  • is simpler to use than Jammit (no config file).
  • more

Jammit is newer and fancyer.

  • it has better compression as it can use the latest compressor from google Closure Compiler considered having the best compression
  • is harder to use than bundle-fu (makes you define a config file)
  • has external dependencies (the java runtime to run the closure or yui compressors, written in java).

Upvotes: 4

John Topley
John Topley

Reputation: 115322

I use Jammit for this.

Upvotes: 1

Related Questions