Skip to content

Instantly share code, notes, and snippets.

@andrewpthorp
Created October 20, 2011 18:08
Show Gist options
  • Save andrewpthorp/1301835 to your computer and use it in GitHub Desktop.
Save andrewpthorp/1301835 to your computer and use it in GitHub Desktop.
ActiveRecord models in helpers
module SomeHelper
def metrics(account)
opens = ContactSnapshot.opens(account, Time.zone.now-30.days, Time.zone.now).size
content_tag :ul do
content_tag :li, "#{opens} Opens."
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment