Forum: Ruby on Rails RSS problem when trying to display ID - HELP

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.
rh (Guest)
on 2006-03-17 20:23
I want to append "#comment-1" or whatever, depending on the id to the
end of my xml.link(" ... /#comment-1") attribute in my generated xml.
Well, when I put:

xml.link(" ... /#comment-" + comment.id)

I get an Application error (rails) message when I look at the generated
XML.  This is what I'm doing without the id on the comments (its working
fine):


xml.instruct! :xml, :version=>"1.0"
xml.rss(:version=>"2.0"){
  xml.channel{
    xml.title("simplebeta comments")
    xml.link("http://simplebeta.com/")
    xml.description("Keep up to date on what others have to say.")
    xml.language("en-us")
    for content in @contents
        for comment in @comments
            if content.comments.include? comment
              xml.item do
                xml.title("[ " + content.title + " ] comment by " +
comment.name.capitalize)
                xml.description(comment.entry)
                # rfc822
                xml.pubDate(comment.created_at.strftime("%a, %d %b %Y
%H:%M:%S %z"))
                xml.link("http://simplebeta.com/inventory/" +
content.posted_at.strftime("%Y") + "/" +
content.posted_at.strftime("%m") + "/" +
content.posted_at.strftime("%d") + "/" + content.permalink +
"/#comments")
              end
            end
        end
    end
  }
}


Any thoughts/ideas why I can't use the 'comment.id' attribute????

Thanks!
Ben R. (Guest)
on 2006-03-17 21:40
(Received via mailing list)
Might try:

xml.link(" ... /#comment-" + comment.id.to_s)
This topic is locked and can not be replied to.