Tag: recurring events

日历中的重复事件 – Rails

我正在寻找模拟重复事件的最佳方法。 我正在使用fullcalendar来显示事件。 但我想反复发生的事件最好在rails后端处理。 我已经查看了其他问题和现有的示例代码,但我没有找到适合的任何内容。 它应该像谷歌日历一样。 因此应该可以删除/修改周期性事件系列的单个事件 。 但是,在数据库中保存事件系列的所有事件似乎效率低下。 此外,应该可以创建单个事件而不会再次发生。 什么是好的模型架构? 我的事件模型现在看起来像那样( 没有其他属性 ): # Table name: events # # id :integer not null, primary key # employee_id :integer # created_at :datetime # updated_at :datetime # starts_at :datetime # ends_at :datetime # class Event < ActiveRecord::Base attr_accessible :starts_at, :ends_at end