Forum: Ruby on Rails xml special characters

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
6fa76b3113f66ea5055ad3f10ab92819?d=identicon&s=25 Grayson Piercee (grayson)
on 2009-02-07 01:37
Hello,

I need to produce XML that looks like this

      <item>
          <title>Image Title</title>
          <media:description>Description of my Image</media:description>
          <media:content url="http://www.mywebsite.com/image.jpg" />
          <media:thumbnail
url="http://www.mywebsite.com/image_thumb.jpg" />
      </item>

but rails doesn't seem to like the ":" in the following code

    for photo in @photos
      xml.item do
        xml.pubDate photo.created_at.rfc822
        xml.title h(photo.profile.name)
        xml.link photo.photo_url
        xml.guid photo.photo_url
        xml.description h(photo.profile.name)
        xml.content photo.photo_url
        xml.thumbnail photo.photo_url
      end

Any way to escape it?

GP
This topic is locked and can not be replied to.