twilio_mime makes returning TwiML in Rails even easier
Time to read: 1 minute
Like any good programmer seeking a better way to do things, Dale built a Rails plugin to take advantage of the framework’s ‘respond_to’ feature.
Using twilio_mime you can respond to Twilio requests using TwiML in the same way you’d handle other mime types.
An example of how this works is available in the project’s readme file on GitHub.
We start with the ‘show’ action of our sample ‘Posts’ controller:
Then, create a view to generate the TwiML response called ‘show.twiml.erb’:
To keep up with the project and read more of Dale’s musings on Ruby, check out his Ruby blog
called Little Shards of Ruby.
twilio_mime has an MIT license and can be found on GitHub. Go check it out!
Photo credit: Carosaurus on Flickr
Related Posts
Related Resources
Twilio Docs
From APIs to SDKs to sample apps
API reference documentation, SDKs, helper libraries, quickstarts, and tutorials for your language and platform.
Resource Center
The latest ebooks, industry reports, and webinars
Learn from customer engagement experts to improve your own communication.
Ahoy
Twilio's developer community hub
Best practices, code samples, and inspiration to build communications and digital engagement experiences.