Skip to content

Instantly share code, notes, and snippets.

@darui00kara
Created May 15, 2015 07:44
Show Gist options
  • Save darui00kara/645f6fa2b89e322df719 to your computer and use it in GitHub Desktop.
Save darui00kara/645f6fa2b89e322df719 to your computer and use it in GitHub Desktop.
# encoding: utf-8
# File Name: sinatra_test.rb
# Create Day is 2015/05/08
# Last Update Day is 2015/05/14
# Gem List
gem 'tilt', '1.4.1'
# Require List
require 'sinatra'
# sinatra reloader is classic type
require 'sinatra/reloader' if development?
require 'haml'
require 'tilt'
# 外部エンコーディングを変更
Encoding.default_external = "UTF-8"
get '/' do
@title = "Hello world!!"
@text = "Hello Haml!!"
haml :index
end
put '/request_print' do
@request_method = request.request_method
@request_url = request.url
@request_path = request.path
haml :request_print
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment