Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Riddle
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
Something went wrong with that request. Please try again.