Skip to content

Commit

Permalink
finished exercise schneems#4
Browse files Browse the repository at this point in the history
  • Loading branch information
asakurasol committed Nov 9, 2013
1 parent 90c140c commit a390d6f
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 4 deletions.
28 changes: 26 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
<h1> Hello</h1>


<html>
<body>
<h1>You're using a layout</h1>
<p>
<h3> I'm a header</h3>
<p>Put things in the header</p>
<a href='http://google.com'>This is a link to google</a>
<a href='me.html'>Me</a>

</p>
<hr />
<div>
<h1> Hello</h1>
<p>
The time is now:
2013-11-09 14:08:47 -0800
2013-11-09 14:37:56 -0800
</p>

<p>
My Name is:

</p>


</div>
<hr />
<div>
<h3> I'm a footer</h3>
<p>Put things in the footer</p>
<a href='http://google2222222.com'>This is a link to google2222222</a>
</div>
</body>
</html>
27 changes: 25 additions & 2 deletions public/me.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
foo


<html>
<body>
<h1>You're using a layout</h1>
<p>
<h3> I'm a header</h3>
<p>Put things in the header</p>
<a href='http://google.com'>This is a link to google</a>
<a href='me.html'>Me</a>

</p>
<hr />
<div>
foo
poo
<h1>watch out!</h1>
<p> dance dance </p>
Expand All @@ -13,4 +27,13 @@ <h1>watch out!</h1>

<li>I like kissing human</li>

</ul>
</ul>
</div>
<hr />
<div>
<h3> I'm a footer</h3>
<p>Put things in the footer</p>
<a href='http://google2222222.com'>This is a link to google2222222</a>
</div>
</body>
</html>
3 changes: 3 additions & 0 deletions server_simple.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@
## Capture control+c to shut down the server
trap 'INT' do server.shutdown end

server.mount_proc '/' do |req, res|
res.body = 'Hello, world!'
end
## Start the server
server.start
8 changes: 8 additions & 0 deletions views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<%
def link_to(name, url)
return "<a href='#{url}'>#{name}</a>"
end
%>

<html>
<body>
<h1>You're using a layout</h1>
<p>
<h3> I'm a header</h3>
<p>Put things in the header</p>
<%= link_to('This is a link to google', 'http://google.com') %>
<a href='me.html'>Me</a>

</p>
Expand All @@ -15,6 +22,7 @@
<div>
<h3> I'm a footer</h3>
<p>Put things in the footer</p>
<%= link_to('This is a link to google2222222', 'http://google2222222.com') %>
</div>
</body>
</html>

0 comments on commit a390d6f

Please sign in to comment.