Forum: Ruby on Rails Using a New Builder Version

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Evan DiBiase (Guest)
on 2006-03-17 18:18
(Received via mailing list)
Hey, folks!

It looks like the version of Builder that's included with Rails
doesn't properly escape characters like ampersand in attribute
values, while the current version of Builder (2.0) does.

I'd like to use this new Builder gem, but I can't seem to get it to
work. I've included the following lines at the top of the controller
that needs the new Builder:

require 'rubygems'
require_gem 'builder', '~> 2.0'

but ampersands are still not properly being escaped.

If I open up the Rails console, do the require bit above, and then
try to generate XML with an ampersand in an attribute, it's still not
escaped. If I open up irb and type in the above lines and try to
generate the same XML, the ampersand *is* escaped. I am extremely
baffled. Can anyone help me out?

This topic is locked and can not be replied to.