ActionController::Base.helpers proxy

Tidbit from RailsCast 132:
ActionController::Base.helpers is a proxy object you can use to access Rails view helpers, outside of views, e.g.:

1
ActionController::Base.helpers.pulralize(products.count, ‘product’)

helper_method

Railscast 20 reminded me that

helper_method :name

makes controller method name available in views.

Mac os x screenshots

As described here, Command-Shift-4 will capture a dragged area of the screen and save it to a file.
Command-Shift-3 will capture the entire screen, or if you have SnapProX running, it activates it.

Leopard screen sharing built-in

I keep forgetting where this is, and I can’t find it in google right now, so lets blog it: The builtin Screen Sharing tool in Mac OS X Leopard is at:

/System/Library/CoreServices/Screen Sharing.app

Just run it and it will prompt you for a server to connect to.  From the command line use open -a with the [...]

Testing named routes in the rails console

Just found out how to test named routes in the Rails console here:

script/console
>> app.webpages_url :site => "foo"
=> "http://www.example.com/foo/webpages"
>>

The mysterious app object is described here.

How to update macports “recipes”

sudo port selfupdate