Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: schneems/ruby_view_server
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: cachemoney/ruby_view_server
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 4 commits
  • 7 files changed
  • 2 contributors

Commits on Jul 10, 2012

  1. hw1 initial comit

    unknown authored and unknown committed Jul 10, 2012
    Copy the full SHA
    a3a6ca5 View commit details

Commits on Jul 12, 2012

  1. section 2 of homework

    cachemoney committed Jul 12, 2012
    Copy the full SHA
    abb422d View commit details
  2. section 3 of homework

    cachemoney committed Jul 12, 2012
    Copy the full SHA
    15f0605 View commit details
  3. section 4 of homework

    cachemoney committed Jul 12, 2012
    Copy the full SHA
    cda463a View commit details
Showing with 114 additions and 6 deletions.
  1. +5 −1 erb_example.rb
  2. +24 −2 public/index.html
  3. +22 −1 public/me.html
  4. +41 −0 public/test.html
  5. +3 −1 server_simple.rb
  6. +7 −1 views/layouts/application.html.erb
  7. +12 −0 views/test.html.erb
6 changes: 5 additions & 1 deletion erb_example.rb
Original file line number Diff line number Diff line change
@@ -2,4 +2,8 @@

x = 42
template = ERB.new "The value of x is: <%= x %>"
puts template.result(binding)
puts template.result(binding)

# array = %w(sonny johnny david douglas)
# atemp = ERB.new "The value of atemp is: <%= atemp %>"
# puts atemp.result(binding)
26 changes: 24 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
<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='me.html'>Me</a>

</p>
<hr />
<div>
<h1> Hello</h1>
<p>
The time is now:
2012-06-16 16:00:08 -0500
2012-07-12 00:03:02 -0500
</p>

<p>
My Name is:

</p>


</div>
<hr />
<div>
<h3> I'm a footer - 2012-07-12 00:03:02 -0500</h3>
<p>Put things in the footer</p>
<a href='http://www.google.com'>Link to google using methods</a>
</div>
</body>
</html>
23 changes: 22 additions & 1 deletion public/me.html
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
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='me.html'>Me</a>

</p>
<hr />
<div>
foo
</div>
<hr />
<div>
<h3> I'm a footer - 2012-07-12 00:03:02 -0500</h3>
<p>Put things in the footer</p>
<a href='http://www.google.com'>Link to google using methods</a>
</div>
</body>
</html>
41 changes: 41 additions & 0 deletions public/test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

<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='me.html'>Me</a>

</p>
<hr />
<div>
<ul>

<li>I like to eat apples</li>

<li>I like to eat oranges</li>

<li>I like to eat bananas</li>

</ul>


<p>

<h2>I go by these aliases:</h2> <h1>jhon</h1>

<h2>I go by these aliases:</h2> <h1>david</h1>

<h2>I go by these aliases:</h2> <h1>arnold</h1>

</p>
</div>
<hr />
<div>
<h3> I'm a footer - 2012-07-12 00:03:02 -0500</h3>
<p>Put things in the footer</p>
<a href='http://www.google.com'>Link to google using methods</a>
</div>
</body>
</html>
4 changes: 3 additions & 1 deletion server_simple.rb
Original file line number Diff line number Diff line change
@@ -9,6 +9,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: 7 additions & 1 deletion views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<%
def link_to(name, url)
return "<a href='#{url}'>#{name}</a>"
end
%>
<html>
<body>
<h1>You're using a layout</h1>
@@ -13,8 +18,9 @@
</div>
<hr />
<div>
<h3> I'm a footer</h3>
<h3> I'm a footer - <%= Time.now %></h3>
<p>Put things in the footer</p>
<%= link_to('Link to google using methods','http://www.google.com') %>
</div>
</body>
</html>
12 changes: 12 additions & 0 deletions views/test.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<ul>
<% ['apples', 'oranges', 'bananas'].each do |fruit| %>
<li>I like to eat <%= fruit %></li>
<% end %>
</ul>


<p>
<%['jhon', 'david', 'arnold'].each do |name| %>
<h2>I go by these aliases:</h2> <h1><%= name %></h1>
<% end %>
</p>