OSDN Git Service

specify HTTP verbs for match in routes
authorNihad Abbasov <narkoz.2008@gmail.com>
Fri, 5 Oct 2012 12:22:01 +0000 (05:22 -0700)
committerNihad Abbasov <narkoz.2008@gmail.com>
Fri, 5 Oct 2012 14:23:57 +0000 (07:23 -0700)
config/routes.rb

index 060fbf1..54b298c 100644 (file)
@@ -184,7 +184,8 @@ Gitlab::Application.routes.draw do
     resources :blame,   only: [:show], constraints: {id: /.+/}
     resources :blob,    only: [:show], constraints: {id: /.+/}
     resources :tree,    only: [:show], constraints: {id: /.+/}
-    match "/compare/:from...:to" => "compare#show", as: "compare", constraints: {from: /.+/, to: /.+/}
+    match "/compare/:from...:to" => "compare#show", as: "compare",
+                    :via => [:get, :post], constraints: {from: /.+/, to: /.+/}
 
     resources :team, controller: 'team_members', only: [:index]
     resources :team_members