Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 22 lines (18 sloc) 0.337 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
require 'wunderbar/sinatra'

get '/' do
  _html do
    _title 'Greeter'
    _style "input {display: block; margin: 2em}"

    _form method: 'post' do
      _p 'Please enter your name:'
      _input name: 'name'
      _input type: 'submit'
    end
  end
end

post '/' do
  _html do
    _title 'Greeter'
    _p "Hello #{@name}!"
  end
end
Something went wrong with that request. Please try again.