Skip to content

Commit

Permalink
Merge pull request rails#5525 from kennyj/fix_5411
Browse files Browse the repository at this point in the history
Fix GH rails#5411. When precompiling, params method is undefined.
  • Loading branch information
josevalim committed Mar 22, 2012
2 parents 89f8866 + 8c262f7 commit b714140
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/sprockets/helpers/rails_helper.rb
Expand Up @@ -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

Expand Down
12 changes: 12 additions & 0 deletions railties/test/application/assets_test.rb
Expand Up @@ -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
Expand Down

0 comments on commit b714140

Please sign in to comment.