In technique #5, we used a method on an array called ‘inspect_raw’. Here’s more about what it does and how to add it to your Rails app:

Put this in lib/array_extensions.rb (or wherever you keep your Ruby core class extensions):


module ArrayExtensions
  # Behaves like Array#inspect only without the '[]‘ around the items.
  def inspect_raw
    inspect_txt = self.inspect
    return inspect_txt.gsub(/[\[\]]/, ”)
  end
end
class Array
  include ArrayExtensions
end

Next add “require ‘array_extensions’” to your config/environment.rb file. This is just a little Ruby magic to extend the Array class to let you do:


a = Array.new(1, 37, 52)
a.inspect_raw #  Returns "1, 37, 52"

Note on Article Origins and Current State of Mailroom

We spent a good 1-2 weeks implementing the techniques outlined in the article, due to the perceived (and actual, at times) slowness of the Load Conversation call in Mailroom. This was the 20% of the app that was causing 80% of the pain after we launched and obtained some traction.

Since then, Charles Jolley has completely rewritten the Mailroom frontend using a as-of-yet-to-be-released AJAX framework (that sits on top of Prototype). Charles is a Cocoa / Objective-C developer; he describes SproutCore as “like Cocoa for web applications.” Be sure to checkout Mailroom to see it in action.