I have a table of events and want to create an action in one of my controllers to allow people to subscribe to an ical so these events will show up in their calendar. Any ideas on how I would do this? I couldnt find anything on google. Thanks. -- 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 -~----------~----~----~----~------~----~------~--~---
Ben Johnson wrote:> I have a table of events and want to create an action in one of my > controllers to allow people to subscribe to an ical so these events will > show up in their calendar. Any ideas on how I would do this? I couldnt > find anything on google. > > Thanks.I''ve done this before. you need to be generating iCalendar (ex vcalendar) files which is a reasonably simple text based format, defined by http://www.ietf.org/rfc/rfc2445.txt (see the bottom of that document for some actual examples. Fred -- 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 -~----------~----~----~----~------~----~------~--~---
On 24 Sep 2007, at 13:32, Ben Johnson wrote:> I have a table of events and want to create an action in one of my > controllers to allow people to subscribe to an ical so these events > will show up in their calendar. Any ideas on how I would do this? I > couldnt find anything on google.The icalendar gem can help with that: http://icalendar.rubyforge.org/ I''m using it along these lines: class EventsController < ActionController::Base def index @events = Event.find(:all) respond_to do |format| format.html format.ics do cal = Calendar.new @events.each do |event| cal_event = Event.new cal_event.start = event.starts_at cal_event.summary = ''My title'' cal_event.description "My Description" cal.add_event(cal_event.to_ical) end render :text => cal.to_ical end end end end James. -- James Stewart Play: http://james.anthropiccollective.org Work: http://jystewart.net/process/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---