Ta-da goes international with UTF-8

One of the simplest ways to make your application more welcoming to non-English speakers is to allow them the right of the native language. Before UTF-8 that was a huge mess of encoding types, but now all it takes is one line. One single meta setting and you can allow for:

The magic string is:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

Make your Ta-da list today

Todo lists have long been one of the favorite features in Basecamp, so we thought it would be a nice experiment to share that particular feature with the world at large. Free of charge. And Ta-da List was born!

A few user-oriented highlights of Ta-da:

  • Extensive use of XMLHttpRequest: Adding new items and checking them on and off are done with remote calls that change their state in the database while simultaneously updating the view using Javascript. This makes it really, really fast to add new items to a list — and you’re not restricted by the 10 predefined fields that most apps like this does.
  • Loose sharing with unique URLs: Sharing a list with a single or group of buddies is easier than ever as there is no password to remember. Instead, everyone just gets a unique URL that they can bookmark right away. At 32 characters and as a MD5 hash, it’s plenty of security for this type of application and much easier to use.
  • Collecting all the shares: By allowing you to share any list with any email address, we already got the viral thing going. The barrier of signing up has been postponed until you’re hooked, and once you are, you automatically collect all the shares as you signup. This means that they’re all available from your dashboard and you can reduce the bookmarked lists down to one URL.

And for the technically inclined:

  • Three levels of caching: I implemented page, action, and fragment caching for the Action Pack in Rails so I could be able to use it in Ta-da. And it’s working exceedingly well. Lots of pages went from 50-70 req/sec to 400-1100 req/sec due to caching.
  • 579 lines of code: That’s including models, controllers, and helpers. It’s really lean and really readable too. It was great to see just how small you can make an application with a recent version of Rails (especially the 0.9.x series) on a fresh code base. In Basecamp, I’m often working on code that predates the release of Rails, so it’s a nice change of scenery.
  • Finally FastCGI: Basecamp is still running mod_ruby for various reasons, but Ta-da is fresh out the gate on FastCGI. And what a difference it makes in memory consumption! We’re currently running five FCGI processes (which is more than plenty) that come in at about 15MB a piece. On top of that, we got 50 Apache processes at just around 3.5MB a piece. That’s just 250MB for the entire setup. Much unlike the situation on Basecamp where we have 40-60 Apache processes of 40MB a piece.

In addition, it seems we’re off to a flying start as we blew through 1,000 people signed up in just a matter of hours! And it’s getting blogged all over the place. Justin French has a really nice post about how he switched his workflow over. And Tobias Luetke already whipped up a script to integrate Ta-da into your site using Ruby.

Rails 0.9.4.1: Cleaning up the mess

Seems like the 0.9.4 release required a public launch in order to find the last snags. No game, no pain, or something. The changes are:

Action Mailer

  • Fixed sending of emails to use Tmail#from not the deprecated Tmail#from_address

Action Pack

  • Fixed bug in page caching that prevented it from working at all
  • Fixed a bug where cookies wouldn’t be set if a symbol was used instead of a string as the key
  • Added assert_cookie_equal to assert the contents of a named cookie

Active Record

  • Fixed that the belongs_to and has_one proxy would fail a test like ‘if project.manager’ — this unfortunately also means that you can’t call methods like project.manager.build unless there already is a manager on the project #492 [Tim Bates]
  • Fixed that the Ruby/MySQL adapter wouldn’t connect if the password was empty #503 [Pelle]

Rails

  • Added 5-second timeout to WordNet alternatives on creating reserved-word models #501 [Marcel Molina]
  • Fixed binding of caller #496 [Alexey]

…you may need to use “gem install rails”, and not just “gem update”, to install the latest version.

Rails 0.9.4: Caching, filters, SQLite3...

Another incredibly strong release sees the light of day as we move one step closer to the mythical 1.0. This release tackles one of the five steps on the roadmap in form of caching as well as adding a bunch of other cool stuff.

  • Render Caching: Added an extensive caching module that offers three levels of granularity (page, action, fragment) and a variety of stores (file, memory, DRb, MemCached). Read more
  • Conditional filters: It’s now possible to limit the actions that a given filter will apply to within a controller using either :only or :except. Like, before_filter :authorize, :only => [ :edit, :delete ]. Read more
  • Associating unsaved objects: Associations between unsaved objects makes it much easier to build big graphs that only makes sense to be saved together. Read more
  • Database compatibility: SQLite3 is now supported by the sqlite adapter and MySQL 4.1.1+ is also supported by the included Ruby/MySQL driver.
  • Numeric bytes and time: Rails has taken upon itself to extend Ruby in a few spots, such as adding the possibility for expressions like 45.kilobytes + 2.3.megabytes and 45.minutes + 2.hours + 1.fortnight. Read more

Those were the highlights, but Rails 0.9.4 includes no less than 50 changes, fixes, and features. You can read the full story in the changelogs for Active Record, Action Pack, and Rails.

This release shouldn’t require any changes to your application if you’re coming from Rails 0.9.3.

An unusual high presence of Macs

Most of the core developers in the Rails community are using Macs and they’re certainly not afraid to say so. In the hours surrounding the latest MacWorld, the #rubyonrails channel could just have well have been renamed the Mac Enthusiast channel (actually, it did have the title “Have you ordered your Mac Mini yet?” for a brief moment). But I didn’t know that we actually had an evangelist among the Rails users that was featured on Apple.com:

Gianni is known as “yipstar” on #rubyonrails who says “I’m working on a bunch. A Flash/Ruby ecommerce site for my brothers Tee-Shirt company. A couple small rails site for my old employer, simple stuff. And I’m almost done with my delicous clone supped up on steroids.” Rock on, Gianni!

Having problems running tests under 1.8.2?

Unfortuntately, the snapshot of test/unit included in Ruby 1.8.2 is broken for use with Rake. Steps are being made to remedy the situation, but in the mean while, you can apply the fix needed to the Ruby source itself. It’s a two-line change, but pretty important two lines.

In order to apply this fix, you need to:

cd /usr/local/lib/ruby/1.8

(or where ever you have Ruby installed) and do:

patch -p0 < /path/to/fix/dir.rb.cleanup.patch

Hopefully a more permanent solution can be found in Rake or Ruby shortly.

It\'s all about the applications

While videos and talk are all nice and good, it’s the applications built that has the power to propel frameworks into stardom. Basecamp has served as a flag bearer for a long time, but with the launch of 43 Things, it’s finally getting some assistance from another high profile public site. Alexander Payne takes note:

43 Things was built on Rails. Rails delights me in portions of my being that I never knew existed, much less were capable of being delighted by a web application framework. My infatuation with Ruby, dormant two long years, has been mightily rekindled by Rails. I really quite genuinely want to drink a beer or 12 with David Heinemeier Hansson.

Sure thing, Alexander. I’ll be in Seattle from the 26th until the 30th. Maybe we can figure out a night out for Rails developers and interested.

But what does "proven" really mean?

Michael J. discusses the obligation of the consultant to pick proven technology for custom jobs, but comes to the conclusion that the question is out of sync. It should focus on potential, not risk. When it does, you start questioning terms like proven:

But what does “proven” really mean? It is important to consider the case where something new takes off fast. At lunch we were specifically discussing Ruby on Rails. Two of us thought it looked pretty good, and one person was thinking about a small test project to check it out. Ruby on Rails has the opportunity to take off quickly because Basecamp was built on it, and everyone who’s used it knows that Basecamp is an awesome product. When they find out it was developed in two months by one guy they cannot believe it. Why only two months? Ruby on Rails, supposedly. Sometimes “new” becomes “mainstream” very quickly. It appears that this could happen to Ruby on Rails this year. That brings with it a host of potential problems, but obsolescence isn’t one of them.

Rails runs through XP Cincinnati

Jim Weirich is a member of the Extreme Programming Cincinnati user group that up until their last meeting was largely a Java gathering. Then something happened as Jim started to show the rest of the group what Rails could do. Mark Windholtz summarized it on their mailing list:

We watched a 10 min Rails video… It blew us away how easy it was to build a minimal web app in 10 minutes. After the video Bill announced that he had a Rails server installed and running. Gerard commented that it took us 2-3 meetings to get Tomcat configured for peoples PCs, while it took Bill about 20 minutes to get a page showing in an unfamiliar technology.

And we realized that XP is not just java (for goodness sake!). We can pair, iterate, and test with Rails just fine. In fact it is probably more XP in that we may be able to talk more about OO design issues that if we were stuck in java land. So it turned out unanimous that we would load-up on Rails and next month start developing something.

I think this is going to be huge amounts of fun.

Welcome to the fun, Mark and the rest of the XP-cincinnati group! You guys should come hang out in #rubyonrails at your next meeting and report on the progress. We’d love to hear how it’s going.

UPDATE: Jim just wrote me with the correction that he wasn’t even at that meeting. The group has upon their own volition found their way to the video and gotten interested off that. That’s even more impressive!

Rails go web services with XML-RPC prototype

Lars Hoss wanted an XML-RPC interface to his Rails-based weblog, so he hacked up a quick prototype:

Pretty neat! We’re currently investigating a number of different schemes for how to officially support Web Services (SOAP/XML-RPC) “The Rails Way”. Where getting good support from two of the commercial entities using Rails for their work. Announcements will follow.

Oh yeah, and Lars is a Tapestry convert, by the way. On the experience with switching from Java/Tapestry to Ruby on Rails, he writes:

Though I still like Tapestry very much, I prefer Rails for my private projects. Private free time is spare and Rails helps me to use it more efficient.