Skip to content

Instantly share code, notes, and snippets.

@kennym
Created September 8, 2012 21:10
Show Gist options
  • Save kennym/3679774 to your computer and use it in GitHub Desktop.
Save kennym/3679774 to your computer and use it in GitHub Desktop.
module ApplicationHelper
def git_version
require 'grit'
repo = Grit::Repo.new(Rails.root + '.git')
# For the sake of brevity just display the first 6 chars of the commit id
last_commit = repo.commits.first.id[0..5]
#{last_commit}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment