Permalink
Browse files

Added a stylesheet_link_tag Radius wrapper.

  • Loading branch information...
1 parent ec50401 commit ac233924c6968fed16f3a9056092ca9db71ab5b6 @nelstrom committed Jun 1, 2009
Showing with 26 additions and 2 deletions.
  1. +24 −0 lib/asset_packager_tags.rb
  2. +2 −2 tasks.todo
@@ -51,6 +51,30 @@ module AssetPackagerTags
end
desc %{
+ Include stylesheets from the public/stylesheets directory
+ Returns an html script tag for each file named in the
+ @sources@ attribute. You can pass multiple filenames,
+ separating them with commas.
+
+ *Usage:*
+ <pre><code><r:stylesheet_include_tag sources="reset,
+ typography, layout" [media="all|screen|print] /></code></pre>
+ }
+ tag 'stylesheet_link_tag' do |tag|
+ options = {}
+ attributes = tag.attr || {}
+ options[:media] = attributes["media"]
+ options[:recursive] = (attributes["recursive"] == "true") ? true : nil
+ options[:cache] = (attributes["cache"] == "true") ? true : nil
+
+ sources = (attributes["sources"] == "all" ?
+ sources = :all :
+ sources = (attributes["sources"] || "").split(",").map{ |s| s.strip })
+
+ stylesheet_link_tag( sources, options )
+ end
+
+ desc %{
Include javascripts from the public/javascripts directory
Returns an html script tag for each file named in the
@sources@ attribute. You can pass multiple filenames,
View
@@ -1,6 +1,6 @@
Radius:
-- javascript_include_merged
-- stylesheet_include_merged
+ javascript_include_merged
+ stylesheet_include_merged
rake tasks:
✓ include tasks from asset_packager rails plugin

0 comments on commit ac23392

Please sign in to comment.