I am working with a lot of legacy data and occasionally a datetime field is nil/null. This breaks the localization. Is there a recommended way of fixing this aside from doing this:
dt = nil
l(dt) unless dt.nil?
Unfortunately, there is no built-in solution. See post.
You can define your own helper that supplies the "nil" human-readable value. Eg:
def ldate(dt)
dt ? l(dt) : t("[???]")
end