Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow ActionController::Base#default_url_options to have a default op…
…tions argument of nil. This fixes a bug introduced in [6a6b439] which was breaking routing in ActionController::UrlWriter.
- Loading branch information
Showing
3 changed files
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ee1d508
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
This change has caused me a bit of a headache to try and figure why some of my redirects to named routes had stopped working after an upgrade to Rails 2.1. I’m probably not the only one to be affected by this either, as changing the definition of a method which is frequently “duck-typed” is really not a good idea, especially when the error message is so cryptic.
For the record the error I received was this:
(eval):2:in `default_url_options’ (eval):2:in`admin_pages_url’Where admin_pages_url is my named route. The code in question in the controller was:
redirect_to admin_pages_urlEnsuring all definitions of default_url_options contain the options = nil part fixes this problem, but I really do not think this change was necessary.
Perhaps this can be reverted to the first version of this change here:
http://github.com/rails/rails/commit/6a6b4392c16c665eb713705f2b38e959a658eeef
Thanks, Sam Lown
ee1d508
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
This change has caused me a bit of a headache to try and figure why some of my redirects to named routes had stopped working after an upgrade to Rails 2.1. I’m probably not the only one to be affected by this either, as changing the definition of a method which is frequently “duck-typed” is really not a good idea, especially when the error message is so cryptic.
For the record the error I received was this:
(eval):2:in `default_url_options’ (eval):2:in`admin_pages_url’Where admin_pages_url is my named route. The code in question in the controller was:
redirect_to admin_pages_urlEnsuring all definitions of default_url_options contain the options = nil part fixes this problem, but I really do not think this change was necessary.
Perhaps this can be reverted to the first version of this change here:
http://github.com/rails/rails/commit/6a6b4392c16c665eb713705f2b38e959a658eeef
Thanks, Sam Lown
ee1d508
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
This change has caused me a bit of a headache to try and figure why some of my redirects to named routes had stopped working after an upgrade to Rails 2.1. I’m probably not the only one to be affected by this either, as changing the definition of a method which is frequently “duck-typed” is really not a good idea, especially when the error message is so cryptic.
For the record the error I received was this:
(eval):2:in `default_url_options’ (eval):2:in`admin_pages_url’Where admin_pages_url is my named route. The code in question in the controller was:
redirect_to admin_pages_urlEnsuring all definitions of default_url_options contain the options = nil part fixes this problem, but I really do not think this change was necessary.
Perhaps this can be reverted to the first version of this change here:
http://github.com/rails/rails/commit/6a6b4392c16c665eb713705f2b38e959a658eeef
Thanks, Sam Lown