aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/sprockets/helpers/rails_helper.rb
diff options
context:
space:
mode:
authorManuel Menezes de Sequeira <MMSequeira@gmail.com>2011-10-05 22:14:49 +0100
committerManuel Menezes de Sequeira <MMSequeira@gmail.com>2011-10-05 22:14:49 +0100
commit07343d2974ab77bfd21c0f35930cd394ba5b164e (patch)
treec64f8b54507d41ccb2c59cb096ee8b1f2a31e2df /actionpack/lib/sprockets/helpers/rails_helper.rb
parent8d775d5f1d58e5c0d881383e8c6e869d1d360c8c (diff)
parentd6c7185d77158caee933e84b247e37bb6a67bf58 (diff)
downloadrails-07343d2974ab77bfd21c0f35930cd394ba5b164e.tar.gz
rails-07343d2974ab77bfd21c0f35930cd394ba5b164e.tar.bz2
rails-07343d2974ab77bfd21c0f35930cd394ba5b164e.zip
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'actionpack/lib/sprockets/helpers/rails_helper.rb')
-rw-r--r--actionpack/lib/sprockets/helpers/rails_helper.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb
index c8c6c3ddd9..f866bc626e 100644
--- a/actionpack/lib/sprockets/helpers/rails_helper.rb
+++ b/actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -8,9 +8,6 @@ module Sprockets
def asset_paths
@asset_paths ||= begin
- config = self.config if respond_to?(:config)
- config ||= Rails.application.config
- controller = self.controller if respond_to?(:controller)
paths = RailsHelper::AssetPaths.new(config, controller)
paths.asset_environment = asset_environment
paths.asset_digests = asset_digests
@@ -65,6 +62,16 @@ module Sprockets
end
alias_method :path_to_image, :image_path # aliased to avoid conflicts with an image_path named route
+ def javascript_path(source)
+ asset_path(source)
+ end
+ alias_method :path_to_javascript, :javascript_path # aliased to avoid conflicts with an javascript_path named route
+
+ def stylesheet_path(source)
+ asset_path(source)
+ end
+ alias_method :path_to_stylesheet, :stylesheet_path # aliased to avoid conflicts with an stylesheet_path named route
+
private
def debug_assets?
compile_assets? && (Rails.application.config.assets.debug || params[:debug_assets])