Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
FeedTools and mime types
Bryan W.
1/9/2007 10:17:00 PM
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, :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...
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
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
FeedTools and mime types
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password