简体   繁体   English

有没有人知道任何与从Rails应用程序向iCal,Google Calendar,Outlook导出事件相关的宝石/插件/教程?

[英]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 already a plug in that does the interaction with iCal, Google APIs that I can use or do I need to just get my hands dirty and write it myself. 我试图弄清楚是否已经插入了与iCal的交互,我可以使用的Google API,或者我需要自己动手并自己编写。

If anyone knows of good resources that I can look at that could help me with the implementation, that would be good as well. 如果有人知道我可以看到的好资源可以帮助我实现,那也会很好。

I am new to RoR and I have been trying to learn it for a while. 我是RoR的新手,我一直试图学习它。 I finally decided to just start playing with my own application rather than just following a book. 我终于决定开始玩我自己的应用程序,而不仅仅是关注一本书。

Any help in this matter would be appreciated. 任何有关此事的帮助将不胜感激。

Thanks! 谢谢!

Check out the Google Calendar gem for rails. 查看Google Calendar gem for rails。 It lets you display a user's Google Calendar in your rails app and they have sample snippets showing how to export events to Google Calendar: 它允许您在rails应用中显示用户的Google日历,并且他们有示例片段,展示如何将事件导出到Google日历:

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)

For iCal, use the iCalendar gem and then you can export events as follows: 对于iCal,使用iCalendar gem ,然后您可以导出事件,如下所示:

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 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否有任何Ruby on Rails gems / jQuery插件/教程可以帮助我实现这个帮助系统? - Are there any Ruby on Rails gems/jQuery plugins/tutorials that might help me implement this help system? 是否有任何应用程序/框架/宝石/插件用于在Ruby on Rails中创建Webshop? - Are there any application/frameworks/gems/plugins for making a Webshop in Ruby on Rails? 任何用于检测孤立记录的rails插件/ gem? - Any rails plugins/gems for detecting orphaned records? 是否有宝石/插件为Rails应用程序提供漂亮的样式 - Are there Gems/Plugins to provide nice styling for Rails application Rails不会从供应商/宝石加载宝石 - Rails does not load gems from vendor/gems 为Rails 3创建插件或gem吗? - Create plugins or gems for Rails 3? 是否有关于使用Rails和extjs构建应用程序的最佳教程? - Is there any best tutorials for the building application with rails and extjs? 使用网络摄像头的Web应用程序...任何Rails插件/宝石? - Web App that uses Webcam…any Rails plugins/gems? 有没有办法告诉Rails进程在运行时加载哪些gem和插件? - Is there any way to tell which gems and plugins are loaded at runtime for a Rails process? 在Rails中进行电子邮件确认,无需使用任何现有的身份验证gem /插件 - Email confirmation in Rails without using any existing authentication gems/plugins
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM