Join 3,551 readers in helping fund MetaFilter (Hide)


How to render an iCalendar using Ruby on Rails.
February 25, 2007 4:11 PM   Subscribe

I'm fairly new to Ruby on Rails and I'm having trouble getting icalendar to play. Can some one point me to a tutorial so that I can learn how to render an iCalendar in a webpage?

Bonus point if it includes standard CRUD for events...
posted by dantodd to Computers & Internet (7 answers total)
 
Have you googled, yet?

It's not real clear what you're asking for, but given the generality of your question it seems the first few results from the search linked above should help you just fine.
posted by twiggy at 4:31 PM on February 25, 2007


Hey Twiggy, when I googled, I only found examples for use in a Ruby app and I've had troubles getting that code to work in the Rails environment.

I understand that the problem isn't complex, I just don't get how to do it yet!
posted by dantodd at 4:51 PM on February 25, 2007


Fourth link if you add "rails" to twiggy's Google search
posted by rhizome at 5:05 PM on February 25, 2007


iCalendar library

If you can do it in Ruby, you can do it in Rails. Start simple. I don't know iCalendar, but take this example code I found there:

cals = Icalendar.parse(cal_file)
cal = cals.first

# Now you can access the cal object in just the same way I created it
event = cal.events.first

puts "start date-time: " + event.dtstart
puts "summary: " + event.summary


Well.. in Rails, just throw similar stuff into a view and work your way up to more complex examples.. for example, in your controller action place the Icalendar.parse stuff.. @cals = Icalendar.parse etc.. then use @cals in a view.
posted by wackybrit at 5:35 PM on February 25, 2007


Thanks everyone. I forgot a @ - I feel silly.
posted by dantodd at 6:16 PM on February 25, 2007


second link from my google search was the one you marked best answer.

just saying.
posted by twiggy at 7:48 PM on February 25, 2007


Thanks Twiggy. No amount of good help can overcome silly typos that I really shouldn't have missed. I've got my app working now. Thanks again.
posted by dantodd at 3:45 PM on February 26, 2007


« Older I'm going to exert myself exce...   |  One of the lightbulbs in my (a... Newer »
This thread is closed to new comments.