-
Notifications
You must be signed in to change notification settings - Fork 57
Route params don't seem to allow periods in values #7
Comments
In you rails app, when you run |
Also, can you provide me with the line that you're using in your rails routes.rb file? Thanks! |
Well, the rails app where I ran into this problem had a much more complicated route (extra contraints and what not), but I just spun up a dummy Rails app to demonstrate the specific example presented above. Route in routes.rb: match "whois/:domain" => "whois#show", via: :get, format: false rake routes:
💚 Accessing 💔 Accessing Also, if I remove the
💚 Accessing 💛 Accessing 💔 Accessing |
Can you test this with Rails 3.1? I put together a test case, both 3-2-stable and 3-1-stable behaved the same, and I want to make sure we're testing the same thing. Also, I ❤️ the hearts!! |
I just tried Rails 3.1 and you're right, my basic example above isn't enough to show the backwards incompatibility I was seeing. It's necessary to have two overlapping routes where the preceding one has a contraint to take care of any ambiguity. I guess I still didn't expect to see the behavior above, but nonetheless, let's try this again: Rails 3.1.3match "whois/:domain" => "whois#show", via: :get, format: false, constraints: { domain: /\w+\.[\w\.]+/ }
match "whois/:id" => "whois#show", via: :get
💚 Accessing 💚 Accessing 💚 Accessing Rails 3.2.0.rc1match "whois/:domain" => "whois#show", via: :get, format: false, constraints: { domain: /\w+\.[\w\.]+/ }
match "whois/:id" => "whois#show", via: :get
💔 Accessing 💚 Accessing 💚 Accessing (Thanks for patiently walking through this with me.) Also, since this issue has sprawled out from its original intention, I'm happy to post this issue somewhere else if you feel it belongs in the Rails issue tracker instead. Let me know. Thanks. |
No problem! I think this is an issue with Journey, so no need to change trackers. I think I know where this is broken, but I need to sleep tonight, so I'll fix tomorrow. Thanks for reporting this! |
Thanks again Aaron! I just got a chance to test this and it works great. 💚 |
Update: This issue has evolved into something different than what was originally suspected as the problem. Read this comment for the actual issue
I've only given this a very brief look, but after upgrading to Rails 3.2.0.rc1, one of our custom routes failed to match certain paths that we expected them to match. It seems that when a route parameter's value contains periods, the match no longer succeeds.
I haven't spent any time grokking the journey codebase yet; however here's a test that I got to fail, but that I would have expected to pass.
The text was updated successfully, but these errors were encountered: