1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

Merge branch 'master' of github.com:sinatra/sinatra

This commit is contained in:
Konstantin Haase 2011-05-17 18:42:16 +02:00
commit 9359c2eca7
2 changed files with 12 additions and 0 deletions

View file

@ -67,6 +67,12 @@ Sinatraでは、ルートはHTTPメソッドとURLマッチングパターンが
params[:splat] # => ["path/to/file", "xml"]
end
ブロックパラーメータを使用した場合:
get '/download/*.*' do |path, ext|
[path, ext] # => ["path/to/file", "xml"]
end
正規表現を使ったルート:
get %r{/hello/([\w]+)} do

View file

@ -80,6 +80,12 @@ via the <tt>params[:splat]</tt> array:
params[:splat] # => ["path/to/file", "xml"]
end
Or with block parameters:
get '/download/*.*' do |path, ext|
[path, ext] # => ["path/to/file", "xml"]
end
Route matching with Regular Expressions:
get %r{/hello/([\w]+)} do