mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
Added wildcard pattern with block parameters in README
This commit is contained in:
parent
b0aca8d075
commit
4ea9980d2c
1 changed files with 6 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue