Skip to content

Instantly share code, notes, and snippets.

@haileys
Created June 22, 2011 08:33
Show Gist options
  • Save haileys/1039701 to your computer and use it in GitHub Desktop.
Save haileys/1039701 to your computer and use it in GitHub Desktop.
require 'sinatra'
enable :sessions
get '/' do
session[:words] ||= []
session[:words].push params[:word] if params[:word]
erb :view
end
<form>
<ul>
<% session[:words].each do |word| %>
<li><%= word %></li>
<% end %>
</ul>
<input type="text" name="word" /> <input type="submit" value="ok" />
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment