consolidating first two exercises into hodgepodge

This commit is contained in:
Dan Buch
2011-08-09 06:29:39 -04:00
parent 1ea05cfb9b
commit fba21e7939
106 changed files with 4 additions and 20580 deletions

View File

@@ -0,0 +1,5 @@
class HelloController < ApplicationController
def world
end
end

View File

@@ -0,0 +1,25 @@
$one = 1
class NovelController < ApplicationController
$two = 2
def index
@title = 'Shattered View: a Novel on Rails'
one_plus_one = 1 + 1
increment_counter one_plus_one
end
def helper_method
@help_message = "I see you've come to me for help."
end
def increment_counter(by)
@counter ||= 0
@counter += by
end
def sequel
$three = 3
end
end

View File

@@ -0,0 +1,7 @@
class StatusController < ApplicationController
def index
time = Time.now
@time = time
@ps = `ps aux`
end
end

View File

@@ -0,0 +1,11 @@
<h1>Several increasingly silly ways of displaying &ldquo;Hello world!&rdquo;:</h1>
<p><%= "Hello world!" %></p>
<p><%= "Hello" + " world!" %></p>
<p><%= w = "world"
"Hello #{w}!" %></p>
<p><%= 'H' + ?e.chr + ('l' * 2) %><%= ('o word!').gsub('d', 'ld')%></p>
<% hello = "Hello" %>
<% world = "world!" %>
<%= hello %> <%= world %>

View File

@@ -2,13 +2,8 @@
<html>
<head>
<title>Hodgepodge</title>
<%= stylesheet_link_tag :all %>
<%= javascript_include_tag :defaults %>
<%= csrf_meta_tag %>
</head>
<body>
<%= yield %>
</body>
<body>
<%= yield %>
</body>
</html>

View File

@@ -0,0 +1,6 @@
<h1><%= @title %></h1>
<p>I looked up, but saw only the number <%= @counter %></p>
<p>&ldquo;What are you doing here?&rdquo; I asked sharply. &ldquo;Was it
<%= @counter.succ %> who sent you?&rdquo;</p>

View File

@@ -0,0 +1,2 @@
<p>Here they come, the counting numbers,
<%= $one %>, <%= $two %>, <%= $three %>.</p>

View File

@@ -0,0 +1,2 @@
<h1>Processes running at <%= @time %></h1>
<pre><%= @ps %></pre>