Skip to content

Instantly share code, notes, and snippets.

@zakuni
Created December 4, 2010 11:15
Show Gist options
  • Select an option

  • Save zakuni/728114 to your computer and use it in GitHub Desktop.

Select an option

Save zakuni/728114 to your computer and use it in GitHub Desktop.
p こんにちは、#{h params[:name]}さん!
a href='/' 戻る
# -*- coding: utf-8 -*-
require 'rubygems'
require 'sinatra'
require 'haml'
require 'slim'
module Sinatra
module Templates
def slim(template, options={}, locals={})
render :slim, template, options, locals
end
end
end
helpers do
include Rack::Utils; alias_method :h, :escape_html
end
get '/' do
slim :index
end
post '/hello' do
slim :hello
end
p あなたの名前は?
form action="/hello" method="POST"
input type="text" name="name"
input type="submit" value="送信"
html
body
h1 Hello World
== yield
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment