asset_packager icon indicating copy to clipboard operation
asset_packager copied to clipboard

Helpers should return safe html

Open fnando opened this issue 15 years ago • 5 comments

All HTML strings should be marked as safe on Rails 3; otherwise, the tags will be escaped.

You can do this by calling the "html_safe" method before returning the strings.

fnando avatar Feb 06 '10 13:02 fnando

Implemented here: http://github.com/fnando/asset_packager/tree/rails3

fnando avatar Feb 10 '10 19:02 fnando

Fix for this is here (link above not working). This will work for rails >= 2.3.6 as well as 3.0.

http://github.com/lardawge/asset_packager/commit/eb633dea77fe8ddd19dfd1e43bf7afcc895abb63

lardawge avatar May 29 '10 00:05 lardawge

This should be merged into master.

airhorns avatar Jul 21 '10 19:07 airhorns

Excellent work on this repo! Is it still actively maintained?

The reason I ask is that I am running into the same Rails 3 issue, downloaded the latest repository and cannot find evidence of the html_safe fix. I intended on writing a test submitting a patch, but running "rake test:plugins PLUGIN=asset_manager" returned this error:

➜ rake test:plugins PLUGIN=asset_packager (in /Users/deploy/Sites/rails_invoice) /Users/deploy/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in require': no such file to load -- action_controller/test_process (LoadError) from /Users/deploy/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:inrequire' from /Users/deploy/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in load_dependency' from /Users/deploy/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:innew_constants_in' from /Users/deploy/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in load_dependency' from /Users/deploy/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:inrequire' from ./vendor/plugins/asset_packager/test/asset_package_helper_development_test.rb:9 from /Users/deploy/.rvm/gems/ree-1.8.7-2010.02/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in load' from /Users/deploy/.rvm/gems/ree-1.8.7-2010.02/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 from /Users/deploy/.rvm/gems/ree-1.8.7-2010.02/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:ineach' from /Users/deploy/.rvm/gems/ree-1.8.7-2010.02/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 rake aborted! Command failed with status (1): [/Users/deploy/.rvm/rubies/ree-1.8.7-2010.0...]

(See full trace by running task with --trace)

chip avatar Mar 30 '11 13:03 chip

Had same problem with the html_safe code not being included in the library I downloaded. Fixed it myself but makes me wonder what else is missing now.

avitus avatar Apr 07 '11 22:04 avitus