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.