Skip to content
Browse files

Support OPTIONS verb in route conditions [#1727 state:resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
  • Loading branch information...
1 parent 5c87e9a commit 5e0f6214d2421a4931c85ee6a239158c69e57b65 @ffmike ffmike committed with lifo Mar 8, 2009
Showing with 9 additions and 1 deletion.
  1. +1 −1 actionpack/lib/action_controller/routing.rb
  2. +8 −0 actionpack/test/controller/routing_test.rb
View
2 actionpack/lib/action_controller/routing.rb
@@ -267,7 +267,7 @@ module ActionController
module Routing
SEPARATORS = %w( / . ? )
- HTTP_METHODS = [:get, :head, :post, :put, :delete]
+ HTTP_METHODS = [:get, :head, :post, :put, :delete, :options]
ALLOWED_REQUIREMENTS_FOR_OPTIMISATION = [:controller, :action].to_set
View
8 actionpack/test/controller/routing_test.rb
@@ -1865,6 +1865,14 @@ def test_route_requirements_with_invalid_http_method_is_invalid
end
end
+ def test_route_requirements_with_options_method_condition_is_valid
+ assert_nothing_raised do
+ set.draw do |map|
+ map.connect 'valid/route', :controller => 'pages', :action => 'show', :conditions => {:method => :options}
+ end
+ end
+ end
+
def test_route_requirements_with_head_method_condition_is_invalid
assert_raises ArgumentError do
set.draw do |map|

0 comments on commit 5e0f621

Please sign in to comment.
Something went wrong with that request. Please try again.