This project is archived and is in readonly mode.
Routing problem in rails 3 rc
-
bug.odesk (at gmail)
Forgot to say that i tested on this route on empty project and got same error.
-
bug.odesk (at gmail)
- Title changed from Routing problem to Routing problem in rails 3 rc
-
Andrew White
- State changed from new to invalid
- Assigned user set to Andrew White
- Importance changed from to Low
Works for me:
# config/routes.db Testapp::Application.routes.draw do match 'test/:param1/:param2' => 'welcome#index', :as => 'random_welcome' end# script/rails c Loading development environment (Rails 3.0.0.rc) >> app.random_welcome_url(:param1 => 'test', :param2 => 'test') => "http://www.example.com/test/test/test"The error log doesn't mention random_welcome_url - it seems to be using download_request_url. I also notice that you're using Haml - can you try with a plain ERb template?
-
bug.odesk (at gmail)
I uploaded empty project with one route and few controllers. Can you please check if
download_request_url :file_token => "aaaaaa33", :file_name => "test.gif"works for you.
-
Andrew White
No need to check it now you've given me the actual code you were using - periods are no accepted by default in params so that /resource/:id(.:format) works. All you need to do is relax the constraint and it'll start working:
match 'dl/:file_token/:file_name' => 'test#download_request', :as => 'download_request', :file_name => /[^\/]+/ -
bug.odesk (at gmail)
Thanks now it works, but when i trying to add regexp for :file_token it fails again.
match 'dl/:file_token/:file_name' => 'test#download_request', :as => 'download_request', :file_token => /[a-f0-9]{32}/, :file_name => /[^\/]+/download_request_url :file_token => "85b3a01dd29b77579b17a2fe179bd9ba", :file_name => "test.gif"Can you tell where is error?
-
Andrew White
- Milestone cleared.
- State changed from invalid to open
- Importance changed from Low to High
This is a bug in the bundled Regin Regexp parser in Rack::Mount (which underlies the Rails 3 router). It's fixed in Regin 0.3.6 but Rack::Mount is only bundled with Regin 0.3.5.
In the meantime you can specify the constraint using a repeated block, e.g:
:file_token = /(?:[a-f0-9]{8}){4}/Slightly hackish, but it does the job.
-
bug.odesk (at gmail)
Thanks.
-
Jeremy Kemper
- Assigned user changed from Andrew White to josh
-
Andrew White
- State changed from open to resolved
Fixed by Rack::Mount 0.6.10: http://github.com/rails/rails/commit/43f44c1a034497fef0a9ed64e0da6f...
