public
Rubygem
Description: Rails Plugin - a Ruby way to manage your stylesheets and javascripts. Don't put all your assets in your layout; define what you need where you need them.
Homepage: http://6brand.com
Clone URL: git://github.com/JackDanger/sweet_assets.git
Search Repo:
name age message
folder History.txt Mon May 26 23:05:53 -0700 2008 adding version number [Jack Danger Canty]
folder MIT-LICENSE Tue Dec 04 12:43:16 -0800 2007 renamed sweet_stylesheets to sweet_assets [studioda]
folder Manifest.txt Mon May 26 23:06:00 -0700 2008 Packaging for rubyforge [Jack Danger Canty]
folder README.txt Mon May 26 23:08:53 -0700 2008 properly formatting (hoe-style) the README.txt [Jack Danger Canty]
folder Rakefile Mon May 26 23:06:00 -0700 2008 Packaging for rubyforge [Jack Danger Canty]
folder init.rb Mon May 26 23:14:23 -0700 2008 moving init.rb under rails/ to use as modern ge... [Jack Danger Canty]
folder install.rb Tue Dec 04 12:43:16 -0800 2007 renamed sweet_stylesheets to sweet_assets [studioda]
folder lib/ Tue Jun 10 23:30:44 -0700 2008 reverting to the old-style verbose rescue handl... [Jack Danger Canty]
folder rails/ Mon May 26 23:14:23 -0700 2008 moving init.rb under rails/ to use as modern ge... [Jack Danger Canty]
folder sweet_assets.gemspec Mon May 26 23:09:13 -0700 2008 adding gemspec dumped from hoe [Jack Danger Canty]
folder test/ Mon May 26 22:52:05 -0700 2008 Complete rewrite. Now supports multi-media css... [Jack Danger Canty]
folder uninstall.rb Tue Dec 04 12:43:16 -0800 2007 renamed sweet_stylesheets to sweet_assets [studioda]
README.txt
= SweetAssets

http://github.com/JackDanger/sweet_assets

== Description

  Automate adding stylesheets and javascripts to your controller actions

== Example

  Any controller will include the stylesheet and javascript source files named after named after the contorller if the 
  file exists:
  
    class UsersController < ApplicationController
      ...
    end
    
    http://mysite.com/users/ will have /stylesheets/users.css and /javascripts/users.js included if they exist.
    
  Any controller can specify any other file to be added as a stylesheet:
  
    class UsersController < ApplicationController
      style_like :homes
      script_like :gargantuan
    end
    
    http://mysite.com/users/ will have users.css, homes.css and gargantuan.js included
    
  Any asset that needs to take precedence over others (i.e. should be linked after the other stylesheets) can be used 
  with a bang (!)
  
    class UsersController < ApplicationController
      style_like :distort_reality!, :homes, :trees
      script_like :basic_script, :super_enhancement!
    end
    
    http://mysite.com/users/ will have homes.css, and trees.css and basic_script.js linked before the <title> tag.
    distort_reality.css and super_enhancement.js will be linked after the <title> tag.
    Note: the controller-named assets (users.css and users.js in this case) will always
    be applied with precedence.

  If you need better control over where these assets appear you can use the same options as you would for a 
  before_filter
    
    class UsersController < ApplicationController
      style_like :homes!, :only => :show
      script_like :trees, :except => [:index, :show]
    end

  All linked assets will be cached into a single asset if caching is enabled.

Copyright (c) 2007 Jack Danger Canty of adPickles Inc, released under the MIT license