Post image for Twilio API and Rails 3 example
Post image for Twilio API and Rails 3 example — Archived thumbnail, 66×66. Full-size article image was not recovered.

I recently created a simple Rails app based on the Twilio API (which is awesome) and the Twilio “appointment reminder” demo.  Twilio allows developers to incorporate telephony into their web apps.  You can use it to allow users to make phone calls or send SMS to your app or have your app call or SMS users, plus features such as audio playback and recording.  Twilio has a Ruby on Rails specific tutorial on their site but it is not written for Rails 3 and so there were some small changes that had to be made. One of the changes is that the url that Twilio calls for the TwiML file needs a .xml extension:

redirect_to BASE_URL + “/goodbye”
becomes
redirect_to BASE_URL + “/goodbye.xml”

The full controller is shown here: