Hi, I am looking to create an rss feed using rails 1.2, is there a way to easily do this by using somthing like format.rss { render :rss => @blogs.to_rss } cheers -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Nicholas Barthelemy
2007-Apr-23 21:41 UTC
Re: is there a to_rss for respond_to blocks in 1.2
I use resource_feeder http://dev.rubyonrails.org/svn/rails/plugins/resource_feeder/ NOTE: This plugin depends on the latest version of simply_helpful, available here: http://dev.rubyonrails.org/svn/rails/plugins/simply_helpful/ Here are a some resources for usage: http://blog.evanweaver.com/articles/2006/09/19/how-to-publish-feeds-with-resource_feeder http://www.ryandaigle.com/articles/2006/09/14/whats-new-in-edge-rails-get-your-rss-atom-feeds-for-free - Nicholas On Apr 23, 3:44 pm, jon <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, > > I am looking to create an rss feed using rails 1.2, is there a way to > easily do this by using somthing like > format.rss { render :rss => @blogs.to_rss } > > cheers > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Nicholas Barthelemy wrote:> I use resource_feeder > > http://dev.rubyonrails.org/svn/rails/plugins/resource_feeder/ > > NOTE: This plugin depends on the latest version of simply_helpful, > available here: > http://dev.rubyonrails.org/svn/rails/plugins/simply_helpful/ > > Here are a some resources for usage: > > http://blog.evanweaver.com/articles/2006/09/19/how-to-publish-feeds-with-resource_feeder > http://www.ryandaigle.com/articles/2006/09/14/whats-new-in-edge-rails-get-your-rss-atom-feeds-for-free > > - Nicholasthanks :-) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ruby has rss functionality built in. See: http://www.rubyrss.com/ you can do something like this: in YourController: def index respond_to do |format| format.rss { render :xml => YourModel.to_rss } end end in YourModel: def self.to_rss() rss = RSS::Rss.new( "2.0" ) channel = RSS::Rss::Channel.new channel.title = "Your Title channel.description = "Your Description." channel.link = "http://www.yoururl.whatever" rss.channel = channel selected_items = self.find( :all, :order => "created_on DESC", :limit => 15) selected_items.each do |selected| item = RSS::Rss::Channel::Item.new item.title = selected.headline item.description = selected.body item.link = "some sort of link to the item" item.pubDate = selected.created_on channel.items << item end return rss.to_s end in your environment.rb: require ''rss/2.0'' - Brian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---