Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Separating erb code in separate files into a new views folder.

  • Loading branch information...
commit 2c95cf4131d839f7c5e7caa9e2997bb6a51655f1 1 parent e847546
@bishboria bishboria authored
View
14 Examples/Calculator/lib/web_calculator.rb
@@ -72,17 +72,3 @@ def load_calculator
display_result_from calculator
end
end
-
-__END__
-@@ layout
-<h1>Calculator is Ready!</h1>
-<%= yield %>
-
-@@ index
-<form method="POST" action="/">
- <input type="text" disabled name="display" id="display" value="<%=@display %>" />
- <input type="text" name="number" id="number" />
- <input type="submit" name="operator" id="minus" text="-" value="minus" />
- <input type="submit" name="operator" id="plus" text="+" value="plus" />
- <input type="submit" name="operator" id="equals" text="=" value="equals" />
-</form>
View
7 Examples/Calculator/views/index.erb
@@ -0,0 +1,7 @@
+<form method="POST" action="/">
+ <input type="text" disabled name="display" id="display" value="<%=@display %>" />
+ <input type="text" name="number" id="number" />
+ <input type="submit" name="operator" id="minus" text="-" value="minus" />
+ <input type="submit" name="operator" id="plus" text="+" value="plus" />
+ <input type="submit" name="operator" id="equals" text="=" value="equals" />
+</form>
View
2  Examples/Calculator/views/layout.erb
@@ -0,0 +1,2 @@
+<h1>Calculator is Ready!</h1>
+<%= yield %>
Please sign in to comment.
Something went wrong with that request. Please try again.