export - Does anyone know any gems/plugins/tutorials related to exporting events to iCal, Google Calendar, Outlook from a Rails application? -
I am trying to figure out if there is a plug in which ICL, Google API or just what I Need to dirty hands and write it yourself?
If someone is aware of good resources which I can think of, which can help me with implementation, it will also be good.
I am new to ROR and I am trying to find out this for a while. After all, instead of just following one book, I started playing with my own application.
Any help in this matter will be appreciated.
Thank you!
Check out for the rail This will display a user's Google Calendar in your Rail app And they have sample snippets showing how to export an event in Google Calendar:
Requires' googlecalendar 'g = GData.new g.login (' REPLACE_WITH_YOUR_MAIL @ gmail. Com ',' REPLACE_WITH_YOUR_PASSWORD ') event = {: title = & gt; Title ',: content => Content ',: author = & gt; Pub.cog ',: email = & gt; Pub .cog @ gmail.com ',: where = & gt; Toulouse, France ',: startTime = & gt; 2007-06-06T15: 00: 00.000Z ',: Timeout = & gt; 2007-06-06 T17: 00: 00.000Z '} g.new_event (event)
Use for iCal, and then you can export events as follows:
requires 'icalendar' class event controller & lt; ApplicationController def export_events @event = Event.find (params [: id]) @ Calendar = Icalendar :: calendar.new event = Icalendar :: Event.new event.start = @ event.dt_time.strftime ("% Y% m% DT% H% M% S ") event.end = @ event.dt_time.strftime ("% Y% m% dT% H% M% S ") event.summary = @ event.summary event.description = @event. Details event.location = @ event.location @ calendar.add event @ calendar. Publish header ['content-type'] = "text / calendar; charset = uTF-8" render_error_layout: text = & gt; @ Calendar.cont_ical ending
Comments
Post a Comment