From 184ef28f55bb576e1eaebf915f8ce64aa8823e90 Mon Sep 17 00:00:00 2001
From: Joshua Peek <josh@joshpeek.com>
Date: Fri, 15 Jan 2010 14:53:54 -0600
Subject: Routing method shorthand shouldn't clobber :to options

---
 actionpack/lib/action_dispatch/routing/mapper.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'actionpack/lib/action_dispatch/routing')

diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 277cb48e50..6ff573443b 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -560,10 +560,10 @@ module ActionDispatch
           if args.first.is_a?(Symbol)
             action = args.first
             if CRUD_ACTIONS.include?(action)
-              return match("(.:format)", options.merge(:to => action))
+              return match("(.:format)", options.reverse_merge(:to => action))
             else
               with_exclusive_name_prefix(action) do
-                return match("/#{action_path(action, resources_path_names)}(.:format)", options.merge(:to => action))
+                return match("/#{action_path(action, resources_path_names)}(.:format)", options.reverse_merge(:to => action))
               end
             end
           end
-- 
cgit v1.2.3