This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Run the following if you haven't already:
gem sources -a http://gems.github.com
Install the gem(s):
sudo gem install JackDanger-sweet_assets
studioda (author)
Tue Dec 04 12:48:44 -0800 2007
commit 362dfe1433ef310427df47b736890fec3916849b
tree 73fd8fa52cca1a20ea8df970482ac6eedad00398
parent 221b7e822738579b1867b531b4c53f9e79cc3a29
tree 73fd8fa52cca1a20ea8df970482ac6eedad00398
parent 221b7e822738579b1867b531b4c53f9e79cc3a29
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Tue Dec 04 12:43:16 -0800 2007 | [studioda] |
| |
README | Tue Dec 04 12:48:44 -0800 2007 | [studioda] |
| |
Rakefile | Tue Dec 04 12:43:16 -0800 2007 | [studioda] |
| |
init.rb | Tue Dec 04 12:43:16 -0800 2007 | [studioda] |
| |
install.rb | Tue Dec 04 12:43:16 -0800 2007 | [studioda] |
| |
lib/ | Tue Dec 04 12:43:16 -0800 2007 | [studioda] |
| |
test/ | Tue Dec 04 12:43:16 -0800 2007 | [studioda] |
| |
uninstall.rb | Tue Dec 04 12:43:16 -0800 2007 | [studioda] |
README
SweetAssets
===============
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 a more traditional before_filter
class UsersController < ApplicationController
before_filter :style_like_homes!, :only => :show
before_filter :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




