Cool

Providing context for Rails’ controller action

There are many scenarios where you might want the same controller action / method in your Rails application to perform multiple functions. For example, a wizard with multiple steps or a single form with multiple-stage AJAX calls. What you want to do is provide a 'context' to the specific request and have the controller handle that in some different way.

Read more →

MeantimeFilter: Wrap your Rails controller actions with scopes

MeantimeFilter is an interesting new plugin for Rails by Roman Le Negrate. It's a little like around_filter, but rather than using a class with 'before' and 'after' methods, it uses a single method (like the other types of filter) and passes in the method to wrap 'around' as a code block. You can then yield to this or pass it into anything you like. An example:

Read more →

Fast HTML parsing in Ruby with Hpricot

Hpricot

Ruby legend whytheluckystuff has developed a new HTML parser called Hpricot. It's easy to install and use and parses HTML in a liberal fashion. It does, however, require a compiler to install (as it's written in C), so should be okay on Linux and Mac OS X, though not necessarily on Windows (yet).

Read more →

TeensyMud – A Ruby MUD (text dungeon) server

TeensyMud is a simple MUD (multi-user dungeon - a bit like a text adventure) server written in Ruby. It's not particularly complex, but it has a great structure and there's a lot to learn from looking at the code (patterns are well used). It's also ripe for extending and for building, perhaps, a proper game or full multi-user environment on.

Read more →