Skip to content

Instantly share code, notes, and snippets.

@seivan
Created October 17, 2010 14:12
Show Gist options
  • Save seivan/630886 to your computer and use it in GitHub Desktop.
Save seivan/630886 to your computer and use it in GitHub Desktop.
def next_message(messages)
begin
debugger
message = messages.queued.next
date = message.arrived_at
rescue NoMethodError => e
date = nil
message = new_message_path
end
date = date ? " in #{time_ago_in_words(date)}" : "when you write one!"
link_to(date, message, :remote => true, :id => "next-mail")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment