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"]
|
params[:splat] # => ["path/to/file", "xml"]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Or with block parameters:
|
||||||
|
|
||||||
|
get '/download/*.*' do |path, ext|
|
||||||
|
[path, ext] # => ["path/to/file", "xml"]
|
||||||
|
end
|
||||||
|
|
||||||
Route matching with Regular Expressions:
|
Route matching with Regular Expressions:
|
||||||
|
|
||||||
get %r{/hello/([\w]+)} do
|
get %r{/hello/([\w]+)} do
|
||||||
|
|
Loading…
Reference in New Issue