Permalink
Browse files

Modaulr style

  • Loading branch information...
1 parent af09918 commit 216663087efa9772b0c10673d30284d345789ce0 @arbales committed Dec 16, 2009
Showing with 22 additions and 3 deletions.
  1. +4 −1 .gems
  2. +15 −1 crouton.rb
  3. +3 −1 models.rb
View
5 .gems
@@ -1 +1,4 @@
-sinatra
+sinatra
+dm-core
+dm-more
+sinatra_warden
View
@@ -1,4 +1,18 @@
require 'rubygems'
require 'sinatra'
-load 'models.rb'
+load 'models.rb'
+
+class Application < Sinatra::Base
+ register Sinatra::Warden
+
+ get '/admin' do
+ authorize!('/login') # require session, redirect to '/login' instead of work
+ haml :admin
+ end
+
+ get '/dashboard' do
+ authorize! # require a session for this action
+ haml :dashboard
+ end
+end
View
@@ -1,8 +1,10 @@
require 'dm-core'
class Person
+ include DataMapper::Resource
+
property :id, Serial
property :name, Text
- porperty :password_hash, Text
+ property :password_hash, Text
property :password_salt, Text
end

0 comments on commit 2166630

Please sign in to comment.