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! -- Posted via http://www.ruby-forum.com/.
Ben Reubenstein
2006-Mar-17 19:37 UTC
[Rails] RSS problem when trying to display ID - HELP
Might try: xml.link(" ... /#comment-" + comment.id.to_s) On 3/17/06, rh <rheath@ircwv.com> wrote:> > 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! > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Ben Reubenstein http://www.benr75.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060317/545e913f/attachment.html