# How to display links inside my rss description?

**URL:** <https://www.ruby-forum.com/t/how-to-display-links-inside-my-rss-description/85879>\
**Category:** Rails\
**Created:** [February 17, 2007, 3:32am UTC](https://www.ruby-forum.com/t/how-to-display-links-inside-my-rss-description/85879 "2007-02-17T03:32:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![patcito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/50afbb/32.png) [@patcito](https://www.ruby-forum.com/u/patcito)\
**Post date:** [February 17, 2007, 3:32am UTC](https://www.ruby-forum.com/t/how-to-display-links-inside-my-rss-description/85879/1 "2007-02-17T03:32:39Z")

</div>

Posts: 76  
how to display links inside my rss description?  
hey all,  
I have that in my rxml:  
xml.instruct!

xml.rss “version” =\> “2.0”, “xmlns:dc” =\>  
“[DCMI: DCMI Metadata Terms](http://purl.org/dc/elements/1.1/)” do  
xml.channel do  
xml.title \_(‘My RSS’)  
xml.link url\_for(:only\_path=\> false,  
:controller=\>‘authors’,  
:action =\> ‘list’)  
xml.pubDate CGI.rfc1123\_date(@items.first.updated\_at)  
xml.description \_(“feed of the day”)  
@items.each do |item|  
xml.item do  
xml.title item.title  
xml.link url\_for(:only\_path =\> false,  
:controller =\> ‘items’,  
:action =\> ‘show’,  
:id =\> list)  
xml.description item.authors.collect do |author|  
link\_to(author.name,:only\_path =\> false,  
:controller =\> ‘items’,  
:action =\> ‘show’,  
:id =\> item.id)

```
end

```

xml.pubDate CGI.rfc1123\_date(list.updated\_at)  
xml.guid url\_for(:only\_path =\> false,  
:controller =\> ‘items’,  
:action =\> ‘show’,  
:id =\> item)  
xml.author h(“no one”)  
end  
end  
end  
end

but then i get that error:  
XmlMarkup cannot mix a text argument with a block

Extracted source (around line #18):

15: :controller =\> ‘items’,  
16: :action =\> ‘show’,  
17: :id =\> list)  
18: xml.description item.authors.collect do |author|  
19: link\_to(author.name,:only\_path =\> false,  
20: :controller =\> ‘items’,  
21: :action =\> ‘show’,  
22: :id =\> item.id)

any idea how I should do this?

Thanx in advance

Pat

---

<div class="post-metadata">

**Author:** ![patcito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/50afbb/32.png) [@patcito](https://www.ruby-forum.com/u/patcito)\
**Post date:** [February 17, 2007, 8:09am UTC](https://www.ruby-forum.com/t/how-to-display-links-inside-my-rss-description/85879/2 "2007-02-17T08:09:54Z")

</div>

Patrick A. wrote:

> Posts: 76  
> how to display links inside my rss description?

It doesn’t look like you’re having trouble with any links… looks like  
Builder doesn’t like you calling a block as an argument to a tag (via  
method\_missing):

> ```
> xml.description item.authors.collect do |author|
> link_to(author.name,:only_path => false,
> :controller => 'items',
> :action => 'show',
> :id => item.id)
> 
> end
> 
> ```

I think you want braces around the content (the block) being passed to  
xml.description:

xml.description {  
item.authors.collect do |author|  
link\_to(author.name,:only\_path =\> false,  
:controller =\> ‘items’,  
:action =\> ‘show’,  
:id =\> item.id)  
end  
}

Looks to me like you also have some typos in there, unless they’re  
features of Builder of which I’m not aware… in particular there is a  
‘\_’ character before a ‘(’ in two places:

xml.title \_(‘My RSS’)

and

xml.description \_(“feed of the day”)

Good luck

b

---

<div class="post-metadata">

**Author:** ![patcito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/50afbb/32.png) [@patcito](https://www.ruby-forum.com/u/patcito)\
**Post date:** [February 17, 2007, 3:46pm UTC](https://www.ruby-forum.com/t/how-to-display-links-inside-my-rss-description/85879/3 "2007-02-17T15:46:35Z")

</div>

On 17-Feb-07, at 2:08 AM, Ben M. wrote:

> Patrick A. wrote:
> 
> > Posts: 76  
> > how to display links inside my rss description?

sorry - just noticed this thread.

this thread will show you how to use resource\_feeder  
(render\_rss\_feed\_for) to render regular old rhtml views for rss/atom  
descriptions.

[http://groups.google.com/group/rubyonrails-talk/browse\_thread/thread/](http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/)  
2b920da418dc9363/beec22ed5fa26fea?lnk=gst&q=&rnum=13#beec22ed5fa26fea

Cheers,  
Jodi  
General Partner  
The nNovation Group inc.  
www.nnovation.ca/blog

---

<div class="post-metadata">

**Author:** ![patcito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/50afbb/32.png) [@patcito](https://www.ruby-forum.com/u/patcito)\
**Post date:** [February 17, 2007, 8:13pm UTC](https://www.ruby-forum.com/t/how-to-display-links-inside-my-rss-description/85879/4 "2007-02-17T20:13:11Z")

</div>

Patrick A. wrote:

> > xml.description \_(“feed of the day”)
> 
> this is not a typo, it’s just ruby gettext synthax 🙂

Ah, cool… so I taught you something and you taught me something! 🙂

b

---

<div class="post-metadata">

**Author:** ![patcito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/50afbb/32.png) [@patcito](https://www.ruby-forum.com/u/patcito)\
**Post date:** [February 17, 2007, 4:24pm UTC](https://www.ruby-forum.com/t/how-to-display-links-inside-my-rss-description/85879/5 "2007-02-17T16:24:40Z")

</div>

thanx a lot.

On 2/17/07, Ben M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Looks to me like you also have some typos in there, unless they’re  
> features of Builder of which I’m not aware… in particular there is a  
> ‘\_’ character before a ‘(’ in two places:
> 
> xml.title \_(‘My RSS’)
> 
> and
> 
> xml.description \_(“feed of the day”)

this is not a typo, it’s just ruby gettext synthax 🙂
