Sinatra 让路
一个路由可以放弃处理,将处理让给下一个匹配的路由,使用 pass:
get '/guess/:who' do
pass unless params[:who] == 'Frank'
'You got me!'
end
get '/guess/*' do
'You missed!'
end
一个路由可以放弃处理,将处理让给下一个匹配的路由,使用 pass:
get '/guess/:who' do
pass unless params[:who] == 'Frank'
'You got me!'
end
get '/guess/*' do
'You missed!'
end