在网上Google了很多次,能找到用rails制作rss,但是总是找不到完整的。今天把完整的过程抄录在这里:* 方法A: 就是你自己把RSS XML的格式拼凑好,输出.并设置HTTP Header ,标记content-type为application/XML,常见的代码: #Post_controller::feed() def feed require “rss” articles = Article.find :all, :order => ‘post_date DESC’, :limit => 10 feed = RSS::Maker.make(“2.0”) do |maker| maker.channel.title = “Gang of Technology” maker.channel.description = “Gang of Technology site” maker.channel.link = “http://up-u.com" maker.items.do_sort = true articles.each do |article| item = maker.items.new_item item.link = “http://www.162cm.com/archives/#{article.id}" item.title = article.title item.date = article.post_date item.description = “” end end send_data feed.to_s, :type => “application/rss+xml”, :disposition => ‘inline’ end