We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60ea6ca commit b5bf0aeCopy full SHA for b5bf0ae
README.markdown
@@ -77,6 +77,15 @@ class Twitter::API < Grape::API
77
end
78
```
79
80
+Optionally, you can define requirements for your named route parameters using regular expressions. The route will match only if
81
+all requirements are met.
82
+
83
+```ruby
84
+get '/show/:id', :requirements => { :id => /[0-9]*/ } do
85
+ Tweet.find(params[:id])
86
+end
87
+```
88
89
## Mounting
90
91
The above sample creates a Rack application that can be run from a rackup *config.ru* file
0 commit comments