Skip to content

Instantly share code, notes, and snippets.

@fliiiix
Created October 31, 2014 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fliiiix/7d67da8e01ac5303b71e to your computer and use it in GitHub Desktop.
Save fliiiix/7d67da8e01ac5303b71e to your computer and use it in GitHub Desktop.
require "sinatra"
configure do
enable :sessions
set :bind, '0.0.0.0'
end
get "/" do
erb :index
end
post "/" do
session[:data] = {"one"=>"a", "two"=>"a"} #params.inspect
p session
params.inspect
end
get "/values" do
session[:data]
end
<form name="test" action="/" method="post">
<input type="text" name="one" />
<input type="text" name="two" />
<input type="submit" value="submit"/>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment