FeedTools and mime types

B

Bryan W.

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

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 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, :eek:rder => "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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top