Permalink
Browse files

Routes fail with leading slash #1540 [Nicholas Seckar]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1555 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 5136c2a commit 453ed1539500f3dc9f704bb0933f50cc42bbe46a @jamis jamis committed Jun 28, 2005
View
@@ -1,5 +1,7 @@
*SVN*
+* Routes fail with leading slash #1540 [Nicholas Seckar]
+
* Added support for upload progress indicators in Apache and lighttpd 1.4.x (won't work in WEBrick or lighttpd 1.3.x) #1475 [Sean Treadway]
See http://sean.treadway.info/files/howto-upload-progress-2.mov for example.
@@ -320,6 +320,7 @@ def matches_controller?(controller)
def initialize_components(path)
path = path.split('/') if path.is_a? String
+ path.shift if path.first.blank?
self.components = path.collect {|str| Component.new str}
end
@@ -574,6 +574,11 @@ def test_default_setup
assert_equal ['admin/user/show', {}], rs.generate({:action => 'show'}, {:controller => 'admin/user', :action => 'list', :id => '10'})
assert_equal ['admin/user/list/10', {}], rs.generate({}, {:controller => 'admin/user', :action => 'list', :id => '10'})
end
+
+ def test_ignores_leading_slash
+ @rs.draw {|m| m.connect '/:controller/:action/:id'}
+ test_default_setup
+ end
def test_time_recognition
n = 10000

0 comments on commit 453ed15

Please sign in to comment.