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, 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_forrss
=> nil))
xml.description(page_title)
@links.each { |p|
xml.item do
xml.title(p.title)
xml.link(@request.protocol + @request.host_with_port +
url_forcontroller => "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
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, 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_forrss
=> nil))
xml.description(page_title)
@links.each { |p|
xml.item do
xml.title(p.title)
xml.link(@request.protocol + @request.host_with_port +
url_forcontroller => "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