When you create a new Rails app the default static page (public/index.html) page shows a lot of details about the app. Here’s a quick how-to show these details (the idea is to probably show these on a /ping route (or a debug parameter on any page maybe) – so you can quickly monitor your app – it’s state, active_record state etc.).
Rails 3 : browse the source-code at railties/lib/rails/info.rb
Or see:
# see https://github.com/rails/rails/blob/v3.0.6/railties/lib/rails/info.rb
@properties = {
:ruby => "#{RUBY_VERSION} (#{RUBY_PLATFORM})",
:rubygem => Gem::RubyGemsVersion,
:rack => ::Rack.release,
:rails => Rails::VERSION::STRING,
:app_root => File.expand_path(Rails.root),
:env => Rails.env,
:db_adapter => ActiveRecord::Base.configurations[Rails.env]['adapter'],
:db_schema_version => (ActiveRecord::Migrator.current_version || nil),
:middleware => Rails.configuration.middleware.map(&:inspect),
}
Rails 2 : browse the source-code at railties/builtin/rails_info/rails/info.rb
Or see:
# see https://github.com/rails/rails/blob/v2.0.2/railties/builtin/rails_info/rails/info.rb
@properties = {
:ruby => "#{RUBY_VERSION} (#{RUBY_PLATFORM})",
:rubygem => Gem::RubyGemsVersion,
:rails => Rails::VERSION::STRING,
:app_root => File.expand_path(RAILS_ROOT),
:env => RAILS_ENV,
:db_adapter => ActiveRecord::Base.configurations[RAILS_ENV]['adapter'],
:db_schema_version => (ActiveRecord::Migrator.current_version || nil),
}
Till the next time…