I have a status controller for reporting how my application is functioning. It has two basic actions:
- How do things look right now?
- Poke all the pieces to update their status, and then process as #1.
The paths are status and status/ping respectively.
I want to restrict these to only GET for status and only POST for status/ping. The current route structure looks like this:
map.connect('status', :controller => 'status', :action => 'index')
map.connect('status/ping', :controller => 'status', :action => 'ping')
I’ve tried various combinations of :via and :only with no success.
How can I impose verb restrictions on these paths?
Thanks!
The
:onlyoption is for the Restful routes. According to the 2.3.8 docs, what you’re looking for is the following.