153 words — 1 minutes read

The Flow (2008-03-02)

Not really getting much done at the moment, but busy nonetheless. Here’s what crossed my newsreader:

try-ing made easy

Did you ever write this in your Ruby or Rails code?

person.name rescue ""

wouldn’t it be nicer to try to to it easier?

person.try(:name)

Chris thinks so too….

I improved on this (spectacularly) and now try supports fail:

person.try(:name, :fail => "no person")

The extension is trivial:

class Object
  def try(method, options = {})
    {:fail => nil }.merge(options)
    if respond_to? method 
      send(method)
    else
      options[:fail]
    end
  end
end

Deploy to Heroku from Git

Heroku allows you to write Rails applications in the browser and deploy to EC2. Now they nice peoble of Heroku have released Heroku API that allows you to use Git. Now this looks even more interesting than before.

Rails Undo / Redo

Do you want to implement Undo/Redo functionality into your Rails applications? Look no further: RUR

Technorati Tags: rails, ruby

Jens-Christian Fischer

Maker. Musician