aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb
diff options
context:
space:
mode:
authorJosh Kalderimis <josh.kalderimis@gmail.com>2010-11-14 22:13:17 +0100
committerJosé Valim <jose.valim@gmail.com>2010-11-16 00:04:36 +0100
commit1c129f8f8ea5b10605ad77af6064c983584d463d (patch)
tree718d76b22c52fa863e61fcc39e4e8a4c22fce982 /actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb
parent91b0b6583428edaec1507c8dbfccfb2056bdedb4 (diff)
downloadrails-1c129f8f8ea5b10605ad77af6064c983584d463d.tar.gz
rails-1c129f8f8ea5b10605ad77af6064c983584d463d.tar.bz2
rails-1c129f8f8ea5b10605ad77af6064c983584d463d.zip
separated the asset id methods to a separate module, removed some dupliation with the various path methods, and moved the base asset tag methods to a base module so the asset id module can play nice with the path generation
Diffstat (limited to 'actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb')
-rw-r--r--actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb b/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb
index 6ae4792b70..1f18e9dfce 100644
--- a/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb
+++ b/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb
@@ -1,8 +1,14 @@
+require 'active_support/concern'
+require 'action_view/helpers/asset_tag_helpers/helper_methods'
+
module ActionView
module Helpers
module AssetTagHelper
+
module StylesheetTagHelpers
extend ActiveSupport::Concern
+ extend HelperMethods
+ include SharedHelpers
included do
mattr_accessor :stylesheet_expansions
@@ -37,10 +43,8 @@ module ActionView
# stylesheet_path "/dir/style.css" # => /dir/style.css
# stylesheet_path "http://www.railsapplication.com/css/style" # => http://www.railsapplication.com/css/style
# stylesheet_path "http://www.railsapplication.com/css/style.css" # => http://www.railsapplication.com/css/style.css
- def stylesheet_path(source)
- compute_public_path(source, 'stylesheets', 'css')
- end
- alias_method :path_to_stylesheet, :stylesheet_path # aliased to avoid conflicts with a stylesheet_path named route
+ asset_path :stylesheet, 'css'
+
# Returns a stylesheet link tag for the sources specified as arguments. If
# you don't specify an extension, <tt>.css</tt> will be appended automatically.
@@ -159,6 +163,7 @@ module ActionView
end
end
+
end
end
end \ No newline at end of file