Skip to content

Instantly share code, notes, and snippets.

@johanbrook
Forked from seivan/snippet.rb
Created October 17, 2010 14:28
Show Gist options
  • Save johanbrook/630903 to your computer and use it in GitHub Desktop.
Save johanbrook/630903 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