public
Created — forked from ruprict/gist:3331587

Riddle

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
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;}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.