Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #5525 from kennyj/fix_5411

Fix GH #5411. When precompiling, params method is undefined.
  • Loading branch information...
commit b714140f4df50d102e70b0151bbb3a09e470d61a 2 parents 89f8866 + 8c262f7
@josevalim josevalim authored
View
2  actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -81,7 +81,7 @@ def stylesheet_path(source)
private
def debug_assets?
compile_assets? && (Rails.application.config.assets.debug || params[:debug_assets])
- rescue NoMethodError
+ rescue NameError
false
end
View
12 railties/test/application/assets_test.rb
@@ -492,6 +492,18 @@ class ::PostsController < ActionController::Base; end
assert_match 'src="/sub/uri/assets/rails.png"', File.read("#{app_path}/public/assets/app.js")
end
+ test "html assets are compiled when executing precompile" do
+ app_file "app/assets/pages/page.html.erb", "<%= javascript_include_tag :application %>"
+ ENV["RAILS_ENV"] = "production"
+ ENV["RAILS_GROUP"] = "assets"
+
+ quietly do
+ Dir.chdir(app_path){ `bundle exec rake assets:precompile` }
+ end
+
+ assert File.exists?("#{app_path}/public/assets/page.html")
+ end
+
private
def app_with_assets_in_view
Please sign in to comment.
Something went wrong with that request. Please try again.