Skip to content

Instantly share code, notes, and snippets.

@Vaysman
Created December 6, 2012 01:28
Show Gist options
  • Save Vaysman/4221138 to your computer and use it in GitHub Desktop.
Save Vaysman/4221138 to your computer and use it in GitHub Desktop.
Simple app with cookie
source :rubygems
gem 'sinatra'
gem 'sinatra-contrib'
require 'sinatra'
require "sinatra/cookies"
get '/' do
haml :index
end
post '/' do
cookies[:name] = params[:name]
end
__END__
@@ layout
%html
%head
%title Test
%body
.content
= yield
@@ index
%h1 Test
%form{action: '/', method: :post}
%label Test
%br
%input{type: :text, name: :name}
%br
%input{type: :submit}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment