Posts Tagged ‘ruby’

Census: Rails Demographics Collection

4.16.10 by Mark Kendall

Much like the United States government, your Rails application may need to collect demographics data for each of its users. That’s where the Census gem comes in. It’s a Rails engine that provides:

  • an administration interface for defining the data you’d like to collect
  • extensions on your User model and forms for collecting users’ responses
  • a simple way to search for users based on their responses

In this post, we’ll take a look at Census by extending a simple Rails app to include a user satisfaction survey.

Read the rest of this entry »

Ruby Call Center

1.18.10 by Gregg Pollack

One of our clients recently started to get frustrated with VOIP/Telco companies that wanted to charge him an arm and a leg to configure his phones to do something customized. Luckily there are some new cloud-based communication web services with killer APIs like Twillio and Tropo.  With these tools any developer can code call functionality into their application, or perhaps even mirror the functionality of a call system with a little Ruby Sinatra Application.

The following video is exactly that Ruby Sinatra App, developed by our own Jacob Swanner:

View On Viddler

Sorry, I can’t show you the code how we did it (this is client work).  However, let me show you an example of the API code.    When someone calls in to the number your service gives you, the cloud service makes a call to your Ruby app and your Ruby app tells Twillio / Tropo what to do. Here’s a quick example from Twillio:

As you can see, the user will be played a Greeting and then asked for their zipcode. Once that zipcode has been captured the cloud service calls back to your Ruby app with the entered information, your Ruby app would retrieve the weather information (inside your controller), then perhaps render this XML View:

There are prettier ways to write XML in Ruby, but you get the picture. The response gets read back to the caller. Both the Twillio documentation and the Tropo documentation are quite useful, especially the examples and both services are reasonably cheap.

If you need any help implementing a call center / voice interface to your app, feel free to give us a ring. We love this stuff.

Getting Started with the Rails 3 BugMash

1.15.10 by Nathaniel Bibler

This is a short writeup to help everyone get ready for the Rails 3 BugMash. The following steps and notes were taken to help you put together a new, working Rails 3 application. Many of these steps will match Yehuda Katz’s post on getting started.

Read the rest of this entry »

Scaling Rails – On The Edge – Part 3

11.25.09 by Gregg Pollack

You can now watch the last episode of the three part series covering some of the newest libraries for helping you scale your Rails apps. This screencast dives into three new libraries that each can help you scale your website in a different way. We start with an introduction to rubber, an alternative to chef / chef deploy which can help you to quickly deploy a server cluster in the cloud. Then we take a look at Cloud Crowd, a completely Ruby background processor which can perform map reduce. Lastly we dive into a web service called Mad Mimi, which isn’t just useful for maintaining mailing lists, but can also host all of your app’s emails.

Scaling Rails

Download this Episode – (81.7 MB, 17:07, MP4)

In this second episode I introduce three tools:

  • rubber – A capistrano/rails plugin for deploying to Amazon ec2.
  • Cloud Crowd – Background job processor with map reduce.
  • Mad Mimi – Scale your mailing lists / campaign emails

These screencasts look great on your iPhone, so I highly encourage you to subscribe and download them on iTunes. Also, to keep up to date on the latest news in the Ruby and Rails community, be sure to check out the Ruby5 podcast if you haven’t already. Thanks!

Scaling Rails – On The Edge – Part 2

11.13.09 by Gregg Pollack

Last week I released the first of a three part series covering some of the newest libraries for helping you scale your Rails apps. Today I bring you part two of the series which starts with a discussion of this article from Sudara Williams. In the article Sudara talks about the true reason why Rails apps can start hogging memory, and then suggests three tools to help prevent this bloat. In this screencast I show you how to use rack-bug, memorylogic, and oink, the three tools he recommends.

Scaling Rails

Download this Episode – (49.5 MB, 10:21, MP4)

In this second episode I introduce three tools:

  • rack-bug – Rails middleware which gives you an informative toolbar in your browser.
  • memorylogic – Gives your logger a memory footprint.
  • oink – Provides metrics on your worst memory bloated requests.

These screencasts look great on your iPhone, so I highly encourage you to subscribe and download them on iTunes. Also, to keep up to date on the latest news in the Ruby and Rails community, be sure to check out the Ruby5 podcast if you haven’t already. Thanks!

Scaling Rails – On The Edge – Part 1

11.5.09 by Gregg Pollack

It’s been a while since I’ve released a new Scaling Rails Screencast, but this morning I’m happy to announce that three new screencasts have been produced and the first one is being released today. In these screencasts I’m going to introduce you to 9 new Ruby and Rails libraries which can help you scale your rails application.

Scaling Rails

Download this Episode – (41.4 MB, 8:49, MP4)

In this first episode I introduce three tools:

  • Bullet – Help you reduce the number of queries with alerts (and growl).
  • Rails Indexes – Rake tasks to find missing indexes.
  • Scrooge – SQL query optimizer, so you query for only what your page needs.

These screencasts look great on your iPhone, so I highly encourage you to subscribe and download them on iTunes. Also, to keep up to date on the latest news in the Ruby and Rails community, be sure to check out the Ruby5 podcast if you haven’t already. Thanks!

The Rails State Machine

8.5.09 by Nathaniel Bibler

Go and StopRuby on Rails recently added a built-in ActiveRecord::StateMachine implementation and even more recently tied it in to ActiveRecord. And, for being a built-in library, it’s pretty damned fully-featured. Really, if this one doesn’t do it for you, then you probably need to write it yourself, anyway.

And, if you’re thinking that you don’t know what a state machine is, or think that you’ve never used one, think again. If you’ve ever used the restful_authentication plugin, you’ve probably used a state machine. In that library, Users can be pending, active, inactive … It’s all the same object, just acting differently depending on its current situation. That, in a nutshell, is a state machine.

Read the rest of this entry »