asset_packager icon indicating copy to clipboard operation
asset_packager copied to clipboard

Issue in asset-packager with rails 3.0.5 due to the unsafe html string

Open Rameshv opened this issue 14 years ago • 0 comments

I am using asset-packager with rails 3.0.5 , had a strange problem. It started printing the js include statements as a text (unsafe html) instead of a html.

It turns out there is a problem in this line of asset_packager_helper.rb

sources.collect {|source| javascript_include_tag(source, options) }.join("\n")
#and 
sources.collect { |source| stylesheet_link_tag(source, options) }.join("\n")    

javascript_include_tag itself returns the safe html input, and by joining them we are producing the unsafe string. To avoid that we can directly call the javascript_include_tag with sources array

javascript_include_tag(sources, options)
#and
stylesheet_link_tag(sources, options)

thanks

Rameshv avatar Aug 25 '11 07:08 Rameshv