From bc3c151236a1b2e96d13b467313c5bf6e0eff540 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 6 Jan 2012 21:01:35 +0000 Subject: [PATCH] Makes /projects/:project_id/issues/new accept PUT requests for when serializing a form with a PUT _method hidden tag. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8528 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- config/routes.rb | 2 +- test/integration/routing/issues_test.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index 6c36d00e3..d7b76bb11 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -160,7 +160,7 @@ ActionController::Routing::Routes.draw do |map| :only => [:update, :destroy] # issue form update project.issue_form 'issues/new', :controller => 'issues', - :action => 'new', :conditions => {:method => :post} + :action => 'new', :conditions => {:method => [:post, :put]} project.resources :issues, :only => [:index, :new, :create] do |issues| issues.resources :time_entries, :controller => 'timelog', :collection => {:report => :get} diff --git a/test/integration/routing/issues_test.rb b/test/integration/routing/issues_test.rb index dc04b7713..1a96176e1 100644 --- a/test/integration/routing/issues_test.rb +++ b/test/integration/routing/issues_test.rb @@ -109,6 +109,10 @@ class RoutingIssuesTest < ActionController::IntegrationTest { :method => 'post', :path => "/projects/23/issues/new" }, { :controller => 'issues', :action => 'new', :project_id => '23' } ) + assert_routing( + { :method => 'put', :path => "/projects/23/issues/new" }, + { :controller => 'issues', :action => 'new', :project_id => '23' } + ) end def test_issues_extra_actions -- 2.39.5