Added wildcard pattern with block parameters in README

This commit is contained in:
Takanori Ishikawa 2011-05-18 01:08:16 +09:00
parent b0aca8d075
commit 4ea9980d2c
1 changed files with 6 additions and 0 deletions

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