Skip to content

Commit

Permalink
Add public folder, layout, and a view.
Browse files Browse the repository at this point in the history
  • Loading branch information
rgraff committed Apr 23, 2010
1 parent 10901eb commit 07bfdf5
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app.rb
Expand Up @@ -3,5 +3,5 @@
require 'config/init'

get '/' do
"Hello World!"
end
erb :home
end
54 changes: 54 additions & 0 deletions public/app.css
@@ -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;
}

4 changes: 3 additions & 1 deletion spec/app_spec.rb
Expand Up @@ -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

3 changes: 3 additions & 0 deletions views/home.erb
@@ -0,0 +1,3 @@
<div style="text-align: center;">
<h1>Hello World</h1>
</div>
15 changes: 15 additions & 0 deletions views/layout.erb
@@ -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.