From 6b5ccdcc16baee4fb863a713c797b987f2d04d6c Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Mon, 8 Aug 2011 21:15:59 -0400 Subject: [PATCH] first crack at system status app --- cookbook/015/01/status/app/controllers/status_controller.rb | 4 +++- cookbook/015/01/status/app/views/status/index.html.erb | 4 ++-- cookbook/015/01/status/config/routes.rb | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cookbook/015/01/status/app/controllers/status_controller.rb b/cookbook/015/01/status/app/controllers/status_controller.rb index 4256a76..7f0ffeb 100644 --- a/cookbook/015/01/status/app/controllers/status_controller.rb +++ b/cookbook/015/01/status/app/controllers/status_controller.rb @@ -1,5 +1,7 @@ class StatusController < ApplicationController def index + time = Time.now + @time = time + @ps = `ps aux` end - end diff --git a/cookbook/015/01/status/app/views/status/index.html.erb b/cookbook/015/01/status/app/views/status/index.html.erb index 0f40df0..d25b601 100644 --- a/cookbook/015/01/status/app/views/status/index.html.erb +++ b/cookbook/015/01/status/app/views/status/index.html.erb @@ -1,2 +1,2 @@ -

Status#index

-

Find me in app/views/status/index.html.erb

+

Processes running at <%= @time %>

+
<%= @ps %>
diff --git a/cookbook/015/01/status/config/routes.rb b/cookbook/015/01/status/config/routes.rb index 57feab2..c1a10d8 100644 --- a/cookbook/015/01/status/config/routes.rb +++ b/cookbook/015/01/status/config/routes.rb @@ -56,5 +56,5 @@ Status::Application.routes.draw do # This is a legacy wild controller route that's not recommended for RESTful applications. # Note: This route will make all actions in every controller accessible via GET requests. - # match ':controller(/:action(/:id(.:format)))' + match ':controller(/:action(/:id(.:format)))' end