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:
swapped the way before_filter options are used.

git-svn-id: http://svn.6brand.com/projects/plugins/sweet_assets@378 
7491b73d-821b-0410-9297-ad1f6b5b4194
studioda (author)
Tue Dec 04 12:54:45 -0800 2007
commit  e23dc2943b447f952360504258f8d22780594e8e
tree    f8e3017ea16f413b6a9086210bc13cce4f2db702
parent  362dfe1433ef310427df47b736890fec3916849b
0
...
35
36
37
38
 
39
40
41
42
 
 
43
44
45
...
35
36
37
 
38
39
40
 
 
41
42
43
44
45
0
@@ -35,11 +35,11 @@
0
     Note: the controller-named assets (users.css and users.js in this case) will always
0
     be applied with precedence.
0
 
0
- If you need better control over where these assets appear you can use a more traditional before_filter
0
+ If you need better control over where these assets appear you can use the same options as you would for a before_filter
0
     
0
     class UsersController < ApplicationController
0
- before_filter :style_like_homes!, :only => :show
0
- before_filter :script_like_trees, :except => [:index, :show]
0
+ style_like :homes!, :only => :show
0
+ script_like :trees, :except => [:index, :show]
0
     end
0
 
0
   All linked assets will be cached into a single asset if caching is enabled.
...
17
18
19
20
 
 
21
22
23
24
 
 
25
26
27
...
17
18
19
 
20
21
22
23
24
 
25
26
27
28
29
0
@@ -17,11 +17,13 @@
0
   
0
   module SweetAssetsShortcuts
0
     def style_like(*assets)
0
- assets.each {|asset| before_filter "style_like_#{asset}".intern }
0
+ options = assets.extract_options!
0
+ assets.each {|asset| before_filter "style_like_#{asset}".intern, options }
0
     end
0
 
0
     def script_like(*assets)
0
- assets.each {|asset| before_filter "script_like_#{asset}".intern }
0
+ options = assets.extract_options!
0
+ assets.each {|asset| before_filter "script_like_#{asset}".intern, options}
0
     end
0
   end
0
   

Comments

    No one has commented yet.