Permalink
Browse files

added erb files

  • Loading branch information...
1 parent 54822f8 commit defdcad83e7762ae0ba8feb92af015b40d5644d6 bry4n committed Nov 13, 2009
Showing with 48 additions and 0 deletions.
  1. +9 −0 app/controllers/welcome.rb
  2. +27 −0 app/views/layout.erb
  3. +12 −0 app/views/welcome/index.erb
  4. BIN db/development.db
@@ -0,0 +1,9 @@
+get "/welcome/?" do
+ @name = "Amazing!"
+ erb :"welcome/index"
+end
+
+get "/hello.json" do
+ content_type "text/plain"
+ JSON.dump({:name => "Hello World"})
+end
View
@@ -0,0 +1,27 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <title>Welcome</title>
+ <link ref="stylesheet" href="/css/main.css" type="text/css" media="screen" charset="utf-8">
+ <style>
+ body { padding: 0; margin: 0; background-color: #f2f2f2; }
+ .header { height: 80px; width: 100%; background-color: #111; padding-top: 20px; }
+ .header h1 { color: #e1e1e1; margin-left: 10px; }
+ .body { clear:both; width: 100%; height: 300px; margin-left: 10px; }
+ .footer { color: #eee; background-color: #444; clear:both; width: 100%; font-size: 12px; text-align: center; bottom: 0px; left: 0px; height: 50px; position: fixed; padding-top: 5px; }
+ </style>
+</head>
+<body>
+<div class="header">
+ <h1> Welcome to Sinatra-MVC </h1>
+</div>
+<div class="body">
+<%= yield %>
+</div>
+<div class="footer">
+ Powered by Sinatra-MVC
+</div>
+</body>
+</html>
@@ -0,0 +1,12 @@
+<h1><%= @name %></h1>
+
+<p>This is working with this application. You can definitely start working on your very first app as the following:</p>
+
+<h5> To edit this page, go to: </h5>
+<p><ul>
+ <li>app/views/layout.erb</li>
+ <li>app/views/welcome/index.erb</li>
+ <li>controllers/welcome.rb</li>
+</ul></p>
+
+<p>For Sinatra documentation, check out <a href="http://sinatrarb.com/">Sinatra</a></p>
View
Binary file not shown.

0 comments on commit defdcad

Please sign in to comment.