Created
August 12, 2012 12:03
-
-
Save ruprict/3331587 to your computer and use it in GitHub Desktop.
Riddle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
require 'sass' | |
require 'slim' | |
get '/css/styles.css' { scss :styles } | |
get '/' do | |
slim :index | |
end | |
get '/new/riddle' do | |
slim :new | |
end | |
post '/riddle' do | |
slim :show | |
end | |
__END__ | |
@@layout | |
doctype html | |
html lang="en" | |
head | |
title== @title || 'Riddle' | |
meta charset="utf-8" | |
link rel="stylesheet" href="/css/styles.css" | |
body | |
header role="banner" | |
h1 | |
a href='/' Riddle | |
a href='/new/riddle' New Riddle | |
#main.content | |
== yield | |
@@index | |
h1 Index Page | |
p This will list all of the riddles | |
@@new | |
form action="/riddle" method="POST" | |
label for="title" Title | |
input#title name="riddle[title]" | |
label for="html" HTML | |
textarea#html cols=60 rows=10 | |
label for="css" CSS | |
textarea#css cols=60 rows=10 | |
label for="js" JS | |
textarea#js cols=60 rows=10 | |
input.button type="submit" value="Save" | |
@@show | |
h1 Riddle Show page | |
p This will show the riddle | |
@@styles | |
form label {display: block;} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment