The important bits: /app/models/entry.rb
& /app/helpers/entries_helper.rb
Even though it’s idiomatic rails, the code organization seems awkward due to the heavy view logic that’s required (currently in the helper). The next step is to start using a View object (or Presenter).