Erubis block helper throwing error with concat

岁酱吖の 提交于 2019-12-05 08:22:41

Actually using the rails_xss plugin, which was my ultimate goal contains a fix for this.

I just had to change my helper to do this concat( content.html_safe! )

since Erubis 2.7.0 you can exploit the :bufvar option in this way:

Erubis::Helpers::RailsHelper.init_properties = {:bufvar => '@output_buffer'}

Erubis and Rails 2.3 don't work together well. Check out this post: http://daveelkins.com/2009/06/18/making-erubis-264-and-rails-23-work-together/ He has created a gem on github that gets them to work together.

Adding

Erubis::Helpers::RailsHelper.init_properties = {:bufvar => '@output_buffer'}

to config/initializers/erubis.rb fixed it for me

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!