so here it is my solution;

/app/config/initializers/revision.rb
filename = File.expand_path('REVISION', RAILS_ROOT)
REVISION =  File.exist?(filename) ? File.read(filename) : `cd
#{RAILS_ROOT} && git rev-parse HEAD`.strip

/app/views/layout/application.html.erb
<%- unless production? %>
  <p id='revision'><%= "#{REVISION[0..3]} #{Time.now.to_s(:db)} "%></
p>
<%- end -%>

/app/helpers/application_helper.rb
  def production?
      @is_production ||=(ENV['RAILS_ENV']=='production')
  end

/public/stylesheets/content.css
        #revision {
                color: gray;
                position: absolute;
                z-index: 9;
                top: 10px;
                left: 0px;
        }

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to