Skip to content

Commit a390d6f

Browse files
committed
finished exercise schneems#4
1 parent 90c140c commit a390d6f

File tree

4 files changed

+62
-4
lines changed

4 files changed

+62
-4
lines changed

public/index.html

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,35 @@
1-
<h1> Hello</h1>
1+
2+
3+
<html>
4+
<body>
5+
<h1>You're using a layout</h1>
6+
<p>
7+
<h3> I'm a header</h3>
8+
<p>Put things in the header</p>
9+
<a href='http://google.com'>This is a link to google</a>
10+
<a href='me.html'>Me</a>
11+
12+
</p>
13+
<hr />
14+
<div>
15+
<h1> Hello</h1>
216
<p>
317
The time is now:
4-
2013-11-09 14:08:47 -0800
18+
2013-11-09 14:37:56 -0800
519
</p>
620

721
<p>
822
My Name is:
923

1024
</p>
1125

26+
27+
</div>
28+
<hr />
29+
<div>
30+
<h3> I'm a footer</h3>
31+
<p>Put things in the footer</p>
32+
<a href='http://google2222222.com'>This is a link to google2222222</a>
33+
</div>
34+
</body>
35+
</html>

public/me.html

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
foo
1+
2+
3+
<html>
4+
<body>
5+
<h1>You're using a layout</h1>
6+
<p>
7+
<h3> I'm a header</h3>
8+
<p>Put things in the header</p>
9+
<a href='http://google.com'>This is a link to google</a>
10+
<a href='me.html'>Me</a>
11+
12+
</p>
13+
<hr />
14+
<div>
15+
foo
216
poo
317
<h1>watch out!</h1>
418
<p> dance dance </p>
@@ -13,4 +27,13 @@ <h1>watch out!</h1>
1327

1428
<li>I like kissing human</li>
1529

16-
</ul>
30+
</ul>
31+
</div>
32+
<hr />
33+
<div>
34+
<h3> I'm a footer</h3>
35+
<p>Put things in the footer</p>
36+
<a href='http://google2222222.com'>This is a link to google2222222</a>
37+
</div>
38+
</body>
39+
</html>

server_simple.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@
1010
## Capture control+c to shut down the server
1111
trap 'INT' do server.shutdown end
1212

13+
server.mount_proc '/' do |req, res|
14+
res.body = 'Hello, world!'
15+
end
1316
## Start the server
1417
server.start

views/layouts/application.html.erb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
<%
2+
def link_to(name, url)
3+
return "<a href='#{url}'>#{name}</a>"
4+
end
5+
%>
6+
17
<html>
28
<body>
39
<h1>You're using a layout</h1>
410
<p>
511
<h3> I'm a header</h3>
612
<p>Put things in the header</p>
13+
<%= link_to('This is a link to google', 'http://google.com') %>
714
<a href='me.html'>Me</a>
815

916
</p>
@@ -15,6 +22,7 @@
1522
<div>
1623
<h3> I'm a footer</h3>
1724
<p>Put things in the footer</p>
25+
<%= link_to('This is a link to google2222222', 'http://google2222222.com') %>
1826
</div>
1927
</body>
2028
</html>

0 commit comments

Comments
 (0)