Skip to content

Instantly share code, notes, and snippets.

@jqr
Created December 22, 2011 14:40
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 jqr/1510515 to your computer and use it in GitHub Desktop.
Save jqr/1510515 to your computer and use it in GitHub Desktop.
Example of using a case statement with params in Sinatra
require 'sinatra'
get '/' do
case params[:input]
when 'hello'
'ahoy'
when 'goodbye'
'seeya'
else
'eh?'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment