-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
generated URL helpers should accept AC::Parameters as an argument. #22832
Comments
I now wonder where the non-parameter arguments to route helpers (i.e. Rails.application.routes.url_helpers.root_url(parameters, only_path: true) |
I don't think this is something that necessarily has to be fixed. I just seemed a bit odd. I'll close. Reopen if you think it's important. |
In fact it should raise an exception like we do in others case. It seems to be a missing case of #20797 |
@rafaelfranca Do you mean without calling |
Yes. We expect users to filter the parameters before passing to url helpers. |
- Earlier only Hash was allowed as params argument to url_helpers. - Now ActionController::Parameters instances will also be allowed. - If the params are not secured then it will raise an ArgumentError to indicate that constructing URLs with non-secure params is not recommended. - Fixes rails#22832.
@rafaelfranca, really? This doesn't seem like a sane default. Why should the user's application be responsible for maintaining the list of special options that change the URL. There are people upgrading rails 4 to 5 that have Every app should convert that to def safe_params
params.except(:host, :port, :protocol, :subdomain, :etc).to_unsafe_h
end Is it unreasonable for |
Also, ActionController::Parameters |
In 5.0.0.beta1
I don't think we should expect the same behavior from the last two invocations of the route helper.
The text was updated successfully, but these errors were encountered: