Skip to content

Instantly share code, notes, and snippets.

@DuoSRX
Created July 21, 2010 19:07
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 DuoSRX/484970 to your computer and use it in GitHub Desktop.
Save DuoSRX/484970 to your computer and use it in GitHub Desktop.
get '/' do
erb :new
end
post '/' do
@paste = Paste.new(:body => params[:paste])
if @paste.save
redirect "#{@paste.id}"
else
redirect '/'
end
end
get '/:id' do
@paste = Paste.get(params[:id])
if @snippet
erb :show
else
redirect '/'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment