Permalink
Browse files

Merge pull request #1473 from lardawge/fix_broken_asset_pipeline_paths

Fix broken asset pipeline paths
  • Loading branch information...
2 parents 80745f1 + 3b75ec9 commit 639dca435ff1a1e075621b1c4deef63c422b26dc @wycats wycats committed Jun 4, 2011
Showing with 5 additions and 6 deletions.
  1. +3 −6 actionpack/lib/sprockets/helpers/rails_helper.rb
  2. +2 −0 actionpack/lib/sprockets/railtie.rb
@@ -4,6 +4,9 @@
module Sprockets
module Helpers
module RailsHelper
+ extend ActiveSupport::Concern
+ include ActionView::Helpers::AssetTagHelper
+
def asset_paths
@asset_paths ||= begin
config = self.config if respond_to?(:config)
@@ -12,12 +15,6 @@ def asset_paths
end
end
- def asset_path(source, default_ext = nil, body = false)
- source = source.logical_path if source.respond_to?(:logical_path)
- path = asset_paths.compute_public_path(source, 'assets', default_ext, true)
- body ? "#{path}?body=1" : path
- end
-
def javascript_include_tag(source, options = {})
debug = options.key?(:debug) ? options.delete(:debug) : debug_assets?
body = options.key?(:body) ? options.delete(:body) : false
@@ -29,6 +29,8 @@ def self.using_coffee?
app.assets = asset_environment(app)
ActiveSupport.on_load(:action_view) do
+ include ::Sprockets::Helpers::RailsHelper
+
app.assets.context_class.instance_eval do
include ::Sprockets::Helpers::RailsHelper
end

1 comment on commit 639dca4

Please sign in to comment.