Skip to content

Commit 3c0b946

Browse files
committed
Add page to display environment variables.
1 parent 1c06e3d commit 3c0b946

7 files changed

Lines changed: 64 additions & 9 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,33 @@
1111
*= require_self
1212
*= require_tree .
1313
*/
14+
15+
.environment-info {
16+
position: absolute;
17+
top: 0;
18+
left: 50%;
19+
width: 200px;
20+
margin-left: -100px;
21+
padding: 10px;
22+
border: 2px solid #80b2d3;
23+
background-color: #fff;
24+
text-align: center;
25+
color: #80b2d3;
26+
27+
a, a:visited {
28+
color: #80b2d3;
29+
text-decoration: none;
30+
}
31+
32+
a:hover {
33+
text-decoration: underline;
34+
}
35+
}
36+
37+
table.environment-variables {
38+
word-break: break-all;
39+
40+
.name {
41+
width: 300px;
42+
}
43+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class EnvironmentController < ApplicationController
2+
def index
3+
end
4+
end

app/helpers/environment_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module EnvironmentHelper
2+
end
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<table class="environment-variables" border="1">
2+
<thead>
3+
<tr>
4+
<th class="name">Name</th>
5+
<th class="value">Value</th>
6+
</tr>
7+
</thead>
8+
<tbody>
9+
<% ENV.sort.each do |name, value| %>
10+
<tr>
11+
<td><strong><%= name %></strong></td>
12+
<td><%= value %></td>
13+
</tr>
14+
<% end %>
15+
</tbody>
16+
</table>

app/views/layouts/application.html.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<title>Getting Things Done with Engine Yard</title>
5-
5+
66
<%= stylesheet_link_tag "application", :media => "all" %>
77
<%= javascript_include_tag "application" %>
88
<%= csrf_meta_tags %>
@@ -11,6 +11,7 @@
1111
<div id="all">
1212
<div id="header">
1313
<h1><span class="intro">Getting Things Done</span> deployed on <span class="branding">Engine Yard</span></h1>
14+
<span class="environment-info"><%= link_to 'Environment Info', environment_path %></span>
1415
<p class="sample">Sample Deployment Application</p>
1516
</div>
1617
<div id="content">

config/routes.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
resources :tasks, except: [:new, :edit, :show]
44
end
55

6+
get 'environment', to: 'environment#index'
7+
68
root "tasks#index"
79
end

db/schema.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
1010
# you'll amass, the slower it'll run and the greater likelihood for issues).
1111
#
12-
# It's strongly recommended to check this file into your version control system.
12+
# It's strongly recommended that you check this file into your version control system.
1313

14-
ActiveRecord::Schema.define(:version => 20110613204114) do
14+
ActiveRecord::Schema.define(version: 20110613204114) do
1515

16-
create_table "lists", :force => true do |t|
16+
create_table "lists", force: :cascade do |t|
1717
t.string "name"
18-
t.datetime "created_at", :null => false
19-
t.datetime "updated_at", :null => false
18+
t.datetime "created_at"
19+
t.datetime "updated_at"
2020
end
2121

22-
create_table "tasks", :force => true do |t|
22+
create_table "tasks", force: :cascade do |t|
2323
t.string "name"
2424
t.boolean "done"
25-
t.datetime "created_at", :null => false
26-
t.datetime "updated_at", :null => false
25+
t.datetime "created_at"
26+
t.datetime "updated_at"
2727
t.integer "list_id"
2828
end
2929

0 commit comments

Comments
 (0)