# RSS Feed parsing problem

**URL:** <https://discuss.rubyonrails.org/t/rss-feed-parsing-problem/41486>\
**Category:** rubyonrails-talk\
**Created:** [April 12, 2009, 7:34pm UTC](https://discuss.rubyonrails.org/t/rss-feed-parsing-problem/41486 "2009-04-12T19:34:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Knorr1](https://avatars.discourse-cdn.com/v4/letter/d/a88e4f/32.png) [@David\_Knorr1](https://discuss.rubyonrails.org/u/David_Knorr1)\
**Post date:** [April 12, 2009, 7:34pm UTC](https://discuss.rubyonrails.org/t/rss-feed-parsing-problem/41486/1 "2009-04-12T19:34:37Z")

</div>

To me the problem is pretty obvious. You are trying to call an undefined method 'feed\_url' on an Array. To make this work you should call the method on each of the items in the Array individually. Like this:

@feeds = @urls.each do |url| &nbsp;&nbsp;@feeds \<\< SimpleRSS.parse open(url.feed\_url) end

You need to know, that whenever you're asking ActiveRecord for multiple records in the database, they will always come back as an Array with each item representing a record or model. But when you're asking for just a single record (Model.find(:first) or Model.find (:last)) you simply get the record/model back.

---

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [April 12, 2009, 8:02pm UTC](https://discuss.rubyonrails.org/t/rss-feed-parsing-problem/41486/2 "2009-04-12T20:02:50Z")

</div>

Nick Hoyle wrote:

> hi thanks for the reply, was much needed.
> 
> I knew what i was trying to do which was like you say call each of the items in the array i just wasnt sure how to do it, and attempted a similar type of loop but had no luck.
> 
> I will look into this and see if i can achieve what i want
> 
> Thanks alot
> 
> nick

just another quick question

how would i able to output each parsed feed from the array @feeds in a view?

---

<div class="post-metadata">

**Author:** ![David\_Knorr1](https://avatars.discourse-cdn.com/v4/letter/d/a88e4f/32.png) [@David\_Knorr1](https://discuss.rubyonrails.org/u/David_Knorr1)\
**Post date:** [April 15, 2009, 7:03pm UTC](https://discuss.rubyonrails.org/t/rss-feed-parsing-problem/41486/3 "2009-04-15T19:03:28Z")

</div>

You would do something like this:

\<ul id="feeds"\> &nbsp;&nbsp;\<%- @feeds.each do |feed| -%\> &nbsp;&nbsp;&nbsp;&nbsp;\<li\>\<%= feed.channel.title %\>\</li\> &nbsp;&nbsp;\<%- end -%\> \</ul\>

Voila, a list of feed titles. 🙂
