From 1c129f8f8ea5b10605ad77af6064c983584d463d Mon Sep 17 00:00:00 2001 From: Josh Kalderimis Date: Sun, 14 Nov 2010 22:13:17 +0100 Subject: 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 --- .../helpers/asset_tag_helpers/stylesheet_tag_helpers.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb') 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, .css will be appended automatically. @@ -159,6 +163,7 @@ module ActionView end end + end end end \ No newline at end of file -- cgit v1.2.3