Permalink
Browse files

Add public folder, layout, and a view.

  • Loading branch information...
rgraff committed Apr 23, 2010
1 parent 10901eb commit 07bfdf5985f7588a7429393ae34a0184ad80c719
Showing with 77 additions and 3 deletions.
  1. +2 −2 app.rb
  2. +54 −0 public/app.css
  3. +3 −1 spec/app_spec.rb
  4. +3 −0 views/home.erb
  5. +15 −0 views/layout.erb
View
4 app.rb
@@ -3,5 +3,5 @@
require 'config/init'
get '/' do
- "Hello World!"
-end
+ erb :home
+end
View
@@ -0,0 +1,54 @@
+body { background-color: #fff; color: #333; }
+
+body, p, ol, ul, td {
+ font-family: verdana, arial, helvetica, sans-serif;
+ font-size: 13px;
+ line-height: 18px;
+}
+
+pre {
+ background-color: #eee;
+ padding: 10px;
+ font-size: 11px;
+}
+
+a { color: #000; }
+a:visited { color: #666; }
+a:hover { color: #fff; background-color:#000; }
+
+.fieldWithErrors {
+ padding: 2px;
+ background-color: red;
+ display: table;
+}
+
+#errorExplanation {
+ width: 400px;
+ border: 2px solid red;
+ padding: 7px;
+ padding-bottom: 12px;
+ margin-bottom: 20px;
+ background-color: #f0f0f0;
+}
+
+#errorExplanation h2 {
+ text-align: left;
+ font-weight: bold;
+ padding: 5px 5px 5px 15px;
+ font-size: 12px;
+ margin: -7px;
+ background-color: #c00;
+ color: #fff;
+}
+
+#errorExplanation p {
+ color: #333;
+ margin-bottom: 0;
+ padding: 5px;
+}
+
+#errorExplanation ul li {
+ font-size: 12px;
+ list-style: square;
+}
+
View
@@ -10,5 +10,7 @@ def app
it "should respond to /" do
get '/'
last_response.should be_ok
+ last_response.body.should include('Hello World')
end
-end
+end
+
View
@@ -0,0 +1,3 @@
+<div style="text-align: center;">
+ <h1>Hello World</h1>
+</div>
View
@@ -0,0 +1,15 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>Hello World</title>
+ <link href="/app.css" media="screen" rel="stylesheet" type="text/css" media="screen, projection" />
+</head>
+<body>
+
+<%= yield %>
+
+</body>
+</html>

0 comments on commit 07bfdf5

Please sign in to comment.