Skip to content

Instantly share code, notes, and snippets.

@furu
Last active December 23, 2015 19:19
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 furu/6681296 to your computer and use it in GitHub Desktop.
Save furu/6681296 to your computer and use it in GitHub Desktop.
# こういうの迷う
get '/foo' do
return '' unless User.exists?(id: params[:id])
# 以下処理...
response
end
get '/foo' do
if User.exists?(id: params[:id])
# 何か処理...
return response
else
return ''
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment