Sha256: 2fbf7459b755bba5e226b05369ae1101ced7a7e78d81b13e10006061de52226e
Contents?: true
Size: 524 Bytes
Versions: 94
Compression:
Stored size: 524 Bytes
Contents
require 'icalendar' class FeedsController < ApplicationController def events calendar = Icalendar::Calendar.new calendar.x_wr_calname = 'Nexmo Developer Events' Event.all.each do |event| calendar.event do |e| e.dtstart = Icalendar::Values::Date.new(event.starts_at) e.dtend = Icalendar::Values::Date.new(event.ends_at + 1.day) e.summary = event.title e.description = event.description end end calendar.publish render plain: calendar.to_ical end end
Version data entries
94 entries across 94 versions & 1 rubygems