Permalink
Browse files

Make named routes work without hashes #1523 [Nicholas Seckar]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1541 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
dhh committed Jun 27, 2005
1 parent 5205e08 commit a7116b6534ee192fd3c64ce927bae424acca2a22
Showing with 7 additions and 1 deletion.
  1. +1 −1 actionpack/lib/action_controller/routing.rb
  2. +6 −0 actionpack/test/controller/routing_test.rb
@@ -538,7 +538,7 @@ def empty?() @routes.empty? end
def each(&block) @routes.each(&block) end
def method_missing(name, *args)
- return super(name, *args) unless args.length == 2
+ return super(name, *args) unless (1..2).include?(args.length)
route = connect(*args)
NamedRoutes.name_route(route, name)
@@ -661,6 +661,12 @@ def setup_for_named_route
x.send :include, ::ActionController::Routing::NamedRoutes
x
end
+
+ def test_named_route_without_hash
+ rs.draw do |map|
+ rs.normal ':controller/:action/:id'
+ end
+ end
end
end

0 comments on commit a7116b6

Please sign in to comment.