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

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
1 participant

Rameshv commented Aug 25, 2011

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment