# FeedTools and mime types

**URL:** <https://www.ruby-forum.com/t/feedtools-and-mime-types/81563>\
**Category:** Ruby\
**Created:** [January 9, 2007, 11:17pm UTC](https://www.ruby-forum.com/t/feedtools-and-mime-types/81563 "2007-01-09T23:17:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![railsroad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e274bd/32.png) [@railsroad](https://www.ruby-forum.com/u/railsroad)\
**Post date:** [January 9, 2007, 11:17pm UTC](https://www.ruby-forum.com/t/feedtools-and-mime-types/81563/1 "2007-01-09T23:17:06Z")

</div>

I’ve been attempting to use FeedTools to generate an RSS feed for my  
app.

When I poke the app from the browser with:  
[http://localhost:3000/feed/rss](http://localhost:3000/feed/rss)

the http:// is stripped out of the URL input and I get this error:  
Safari canâ€™t open the page â€œlocalhost:3000/feed/rssâ€ because it cannot  
redirect to locations starting with â€œlocalhost:â€.

Firefox seems to think that [http://localhost:3000/feed/rss](http://localhost:3000/feed/rss) is an  
application I might need to download.

So I’m thinking that the problem stems from the mime type (content-type)  
not being set correctly.  
I don’t see where I can change this.

# Here is the Controller Code:

class FeedController \< ApplicationController  
require ‘feed\_tools’

def rss  
@links = Link.find( :all, :order =\> “created\_at”, :limit =\> 20)  
@headers[“Content-Type”] = “application/rss+xml”

```
@feed = FeedTools::Feed.new
@feed.title = "Railsroad"
@feed.subtitle = "Climbing the Ruby learning curve"
@feed.link = "http://www.railsroad.com/feed/rss"

```

end  
end

# This is the rss.rxml

xml.rss(‘version’ =\> ‘2.0’) do  
xml.channel do  
xml.title(page\_title)  
xml.link(@request.protocol + @request.host\_with\_port + url\_for(:rss  
=\> nil))  
xml.description(page\_title)

```
@links.each { |p|
  xml.item do
  xml.title(p.title)
  xml.link(@request.protocol + @request.host_with_port +

```

url\_for(:controller =\> “links”, :action =\> “discuss”, :id =\> p.id))  
xml.description( h(p.description))  
xml.pubDate(p.created\_at)  
end  
}  
end  
end

#############

I was also thinking that maybe it has something to do with the fact that  
I’ve not defined a layout for the FeedController and so it’s trying to  
use layout/application.rhtml

All suggestions are appreciated.

thanks,  
Bryan
