Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

finished up first swipe at getting this thing running

  • Loading branch information...
commit 124d4e59dddca3aacdb2e3368570a9fbb6ab03b8 1 parent 0c4947d
Greg Nokes authored
2  MIT-LICENSE
... ...
@@ -1,4 +1,4 @@
1  
-Copyright (c) 2009 Nick Plante
  1
+Copyright (c) 2009 Greg Nokes
2 2
 
3 3
 Permission is hereby granted, free of charge, to any person obtaining
4 4
 a copy of this software and associated documentation files (the
4  README.rdoc
Source Rendered
... ...
@@ -1,7 +1,7 @@
1 1
 = Sinatra Application Template
2 2
 
3 3
 A base Sinatra application template. Just fork and build. Yay!
4  
-Includes ActiveRecord, RSpec, and erv, all ready to go.
  4
+Includes ActiveRecord, RSpec, and erb, all ready to go.
5 5
 
6 6
 == Configuration
7 7
 
@@ -13,7 +13,7 @@ Add your controller actions in <tt>application.rb</tt>. Views for these actions
13 13
 
14 14
 Add your specs in <tt>spec</tt>; just require <tt>spec_helper.rb</tt> to pre-configure the test environment. A number of samples are provided (including a sample model, which can be removed). To run the specs:
15 15
 
16  
-  rake spec
  16
+  rake spec or just rake
17 17
 
18 18
 == Getting Started
19 19
 
3  application.rb
@@ -2,6 +2,7 @@
2 2
 require 'sinatra'
3 3
 require 'environment'
4 4
 
  5
+
5 6
 configure do
6 7
   set :views, "#{File.dirname(__FILE__)}/views"
7 8
 end
@@ -18,5 +19,7 @@
18 19
 
19 20
 # root page
20 21
 get '/' do
  22
+  @user = User.all()
  23
+  @time = Time.now()
21 24
   erb :root
22 25
 end
BIN  db/development.sqlite3
Binary file not shown
1  environment.rb
@@ -3,7 +3,6 @@
3 3
 require 'erb'
4 4
 require 'ostruct'
5 5
 require 'yaml'
6  
-
7 6
 require 'sinatra' unless defined?(Sinatra)
8 7
 
9 8
 configure do
4  views/layout.erb
... ...
@@ -1,11 +1,11 @@
1 1
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
2 2
 <html>
3 3
 	<head>
4  
-		<title>Some Random Website</title>
  4
+		<title><%= SiteConfig.title %></title>
5 5
 	</head>
6 6
 	<body>
7 7
 		
8  
-		<% content = yield %>
  8
+		<%= yield %>
9 9
 		
10 10
 		
11 11
 	</body>
15  views/root.erb
... ...
@@ -0,0 +1,15 @@
  1
+<p>Hey Nonny Nonny! It's <%= @time %> </p>
  2
+
  3
+
  4
+<p><ul>
  5
+	<% unless @user.nil? || @user.empty? %>
  6
+     <% @user.each do |u| %>
  7
+       <li>Hi <%= u.name %></li>
  8
+     <% end %>
  9
+   <% else %>
  10
+       <li>No Users Yet</li>
  11
+   <% end %>
  12
+</ul></p>
  13
+
  14
+
  15
+<p><small>by <%= SiteConfig.author %></small></p>

0 notes on commit 124d4e5

Please sign in to comment.
Something went wrong with that request. Please try again.