Added wildcard pattern with block parameters in README
This commit is contained in:
parent
b0aca8d075
commit
4ea9980d2c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue