Mr. Voice On Rails
After saying for about a year I was going to do it, I’ve finally revamped the Mr. Voice website. It’s gone from a mostly-broken PHP system to a pretty fun Ruby on Rails-based application. While I’m sure there’s more that I can do with the site, it’s meeting or exceeding the capabilities of the old site, so I flipped the switch this afternoon.
A big win, at least from a mental standpoint, was redoing the database structure to match what Rails expects and, as a side effect, getting a database that was more logically named and laid out than the old one.
One fun thing was reimplementing the XML-RPC API for the client application in Rails. The Mr. Voice software can talk via XML-RPC to the website, so that people can query and share sound clips with other Mr. Voice users. The client software is in Perl, and the previous incarnation of the API was also in Perl, which was pretty forgiving. Moving that over to Rails’ ActionWebService format wasn’t too hard, but there were some small data format issues that I had to work around. Since all of the clients out in the world are still using the old API, though, I rewrote the Perl version to talk to the new database.
I split the information about the Troupes using Mr. Voice into its own table (vs. an XML file in the old system) and added latitude and longitude information. Thus, I was able to use the Cartographer plugin to generate the Users map on the fly from that data. Pretty slick.
Because Rails makes AJAX so easy, I was able to add a few AJAX calls to dynamically render parts of the page, such as the login box, song info box, and shopping cart stuff. I was also able to use RJS templates, so that when you add an item to the cart, a series of effects happen to let you know what’s going on. I also found out that you can drive yourself crazy if you set a global Content-Type header of “text/html”, and then try to figure out why your RJS templates are broken (hint: RJS reponses need to be sent as “text/javascript”).
I was even able to use ActionMailer to implement a “lost key” emailing system and new key request form. Also in the email front, I installed the exception_notification plugin to send me email when something in the app breaks (so I got a few emails when people hit it and tripped over some bugs I hadn’t caught).
So I’m pleased with it. Head on over and check it out!





