誰もがRailsアプリケーションからのiCal、Googleカレンダー、Outlookにイベントをエクスポートに関連するすべての宝石/プラグイン/チュートリアルを知っていますか?

StackOverflow https://stackoverflow.com/questions/493300

質問

私は、プラグがその中にすでに存在する場合に把握しようとしています、私は使用することができますまたは私はちょうど私の手が汚れて取得し、それを自分自身を記述する必要はないのiCal、GoogleのAPIとの対話を行います。

誰もが、私はそれを見ることができる良いリソースを知っている場合にも良いだろうと、実装で私を助けることができます。

私はRoRのに新しいですし、私はしばらくの間、それを学ぶしようとしています。私は最終的にちょうど私自身のアプリケーションと一緒に遊んではなく、単に本を次開始することを決めました。

この問題で任意の助けいただければ幸いです。

ありがとうございます。

役に立ちましたか?

解決

レールのためのGoogleカレンダーの宝石のrel="noreferrer">

require 'googlecalendar'
g = GData.new
g.login('REPLACE_WITH_YOUR_MAIL@gmail.com', 'REPLACE_WITH_YOUR_PASSWORD')
event = { :title=>'title',
:content=>'content',
:author=>'pub.cog',
:email=>'pub.cog@gmail.com',
:where=>'Toulouse,France',
:startTime=>'2007-06-06T15:00:00.000Z',
:endTime=>'2007-06-06T17:00:00.000Z'}
g.new_event(event)

iCalのために、 iCalendarの宝石と次のように、あなたは、イベントをエクスポートすることができます:

require ‘icalendar’

class EventController < 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.description
    event.location = @event.location
    @calendar.add event
    @calendar.publish
    headers['Content-Type'] = “text/calendar; charset=UTF-8″
    render_without_layout :text => @calendar.to_ical
  end
end
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top