This project is archived and is in readonly mode.
Rails 3 RC Routing: resource member routes lack defaults
-
Santiago Pastorino
- Importance changed from to Low
I can't reproduce this, can you provide more info, try doing a test case or upload an application?.
Thanks. -
Andrew White
- Milestone cleared.
- State changed from new to open
- Assigned user set to Andrew White
I think the problem is the guide shows the example using a string, whereas it should really be a symbol. I can't reproduce the missing action error but it is correct that the route isn't named.
The action is added here, however I leaning towards thinking that it should removed and require the action to be specified. The problem with adding the action and name by default when specifying a custom action as a string is that you can add extra parameters in the path so you should really be adding all the options. e.g:
resources :photos do get 'preview/:size', :on => :member endIt wouldn't add too much overhead to add a regexp check on the name to see if it's compatible with adding it by default I guess, but the guide definitely needs updating.
-
Andrew White
Okay, here's a patch to add a default name and action if the string is just alphanumeric.
-
Santiago Pastorino
- Assigned user changed from Andrew White to José Valim
I should be sleepy when i watched to this but i agree with Andrew, also +1 for the patch.
Just wait for José resolution :). -
Repository
- State changed from open to resolved
(from [7a7012c7177fd9811305c03b1db0ec0d5008f19e]) Fix a bug where symbols and strings were not behaving the same in the router. [#5431 Rails 3 RC Routing: resource member routes lack defaults state:resolved] http://github.com/rails/rails/commit/7a7012c7177fd9811305c03b1db0ec...
-
Repository
(from [8feb2856ea1e813bdefe64e9820cd1005aa5ad92]) When custom resource actions are specified using strings add the default name and action if the string is a valid ruby method name.
[#5431 Rails 3 RC Routing: resource member routes lack defaults state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/8feb2856ea1e813bdefe64e9820cd1... -
Repository
(from [b4f304b7b68e0b4fd780cc6d0944edefc362669d]) Fix a bug where symbols and strings were not behaving the same in the router. [#5431 Rails 3 RC Routing: resource member routes lack defaults state:resolved] http://github.com/rails/rails/commit/b4f304b7b68e0b4fd780cc6d0944ed...
-
Repository
(from [2fb0cbec024c5b51451deab7e390e2d4f712cf8f]) When custom resource actions are specified using strings add the default name and action if the string is a valid ruby method name.
[#5431 Rails 3 RC Routing: resource member routes lack defaults state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/2fb0cbec024c5b51451deab7e390e2...
