Skip to content

Instantly share code, notes, and snippets.

@ruprict
Created August 12, 2012 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ruprict/3331587 to your computer and use it in GitHub Desktop.
Save ruprict/3331587 to your computer and use it in GitHub Desktop.
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