Example of use in Rails?

430 views
Skip to first unread message

Nick Roosevelt

unread,
Sep 13, 2011, 12:55:56 AM9/13/11
to RiCal
Is there an example of ri_cal in a rails controller?

Thanks,

Nick

chip

unread,
Sep 13, 2011, 6:27:41 PM9/13/11
to RiCal
If you're trying to display an iCal stream in a Rails project, the
following should work (although I haven't done much with Rails in some
time)

# controller
require 'ri_cal'
@cal = RiCal.parse_string your_ical_string

# view
<% @cal.each do |cal| %>
<% events.each do |event| %>
Event Name: <%= event.summary %><br \>
Event Month: <%= event.dtstart.month %><br \><br \>
<% end %>
<% end %>

chip

unread,
Sep 13, 2011, 6:36:52 PM9/13/11
to RiCal
Sorry that should be

<% cal.events.each do |event| %>
Reply all
Reply to author
Forward
0 new messages