rails/rails — Issue #4245: Route helper uses . instead of /
Author: larspind
Created: 2011-12-31 12:12:35+00:00
State: open

Hi @tenderlove,

Thanks a lot for fixing #4164 ...

now there's a new problem, illustrated in the updated app at:

https://github.com/larspind/rails-3-2-routes-priority-change

Here are my routes, roughly lifted from my actual app:

```
resources :purchases
match 'purchase/:product_id' => 'purchases#new', :as => :new_purchase
match 'purchase/:product_id' => 'purchases#new', :as => :correct_new_purchase
```

Here is the test that fails:

```
assert_equal correct_new_purchase_url(products(:one)), new_purchase_url(products(:one))
```

which outputs:

```
1) Failure:
test_new_purchase_url(ModelsControllerTest) [/Users/lars/Sites/routes-test/test/functional/models_controller_test.rb:5]:
<"http://test.host/purchase/980190962"> expected but was
<"http://test.host/purchase.980190962">.
```

So the URL because purchase.:product_id instead of purchase/:product_id.

No idea why.

Happy new year, you fine people! :)

//Lars