Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
playonverbs committed Nov 10, 2011
0 parents commit cc2c28c
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
30 changes: 30 additions & 0 deletions basics.rb
@@ -0,0 +1,30 @@
require 'sinatra'
require 'haml'


get '/' do
haml :index
end

get '/hello/:name' do
"Hello #{params[:name]}!"
end

get '/about' do
haml :index
end

get '/form' do
erb :form
end

# config = {
# :urls => { :url_github => 'https://github.com/' }
# github: [
# user: 'pixelwolf', :repos = {
# :coffeh => { :name => 'coffeh' , :url => 'https://github.com/pixelwolf/coffeh/' , :forked => false },
# :vimrc => { :name => 'vimrc' , :url => 'https://github.com/pixelwolf/vimrc/' , :forked => false },
# :lesscss => { :name => 'lesscss.org', :url => 'https://github.com/pixelwolf/lesscss.org/' , :forked => true }
# }
# ]
# }
6 changes: 6 additions & 0 deletions data.rb
@@ -0,0 +1,6 @@
require 'dm-core'
require 'dm-timestamps'
require 'dm-validations'
require 'dm-migrations'


34 changes: 34 additions & 0 deletions main.rb
@@ -0,0 +1,34 @@
require 'sinatra'
include 'data.rb'
require 'haml'

get '/' do
erb :models
end

get '/models' do
erb :models
end

get '/login' do
erb :login
end

post '/login' do
if params[:user] == "admin" && params[:passwd] == "password"
redirect '/admin'
else
"try again"
end
end

get '/admin' do
erb :admin
end

post '/admin' do
entry = models.new
entry.make = params[:make]
entry.model = params[:model]
entry.price = params[:price]
end

0 comments on commit cc2c28c

Please sign in to comment.