icalendar - How Do I create an .ics file with rails and ri_cal? -
i using rails 3 , ri_cal gem. not able produce valid .ics file. gets generated, applecalendar or googlecalendar it's empty. did wrong? appreciated, in advance :)
my controller
class websitescontroller < applicationcontroller def index respond_to |format| format.ics end end end
and index.ics.builer
rical.calendar event description "ma-6 first manned spaceflight" dtstart datetime.parse("2/20/1962 14:47:39") dtend datetime.parse("2/20/1962 19:43:02") location "cape canaveral" add_attendee "john.glenn@nasa.gov" alarm description "segment 51" end end end
i able succeed in getting ics created
def index cal =rical.calendar event description "ma-6 first manned spaceflight" dtstart datetime.parse("1962-02-20") dtend datetime.parse("1962-02-20") location "cape canaveral" add_attendee "john.glenn@nasa.gov" alarm description "segment 51" end end end respond_to |format| format.ics { send_data(cal.export, :filename=>"mycal.ics", :disposition=>"inline; filename=mycal.ics", :type=>"text/calendar")} end end
no need discrete builder
Comments
Post a Comment