-
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
Add always permitted parameters as a configurable option. #15933
Conversation
rafael
commented
Jun 27, 2014
- This commit adds back the always_permitted_parameters configuration option to strong parameters.
- The initial pull requests where this feature was added are the following:
- make always permitted parameters configurable #12682
- making always permitted params configurable strong_parameters#174
* This commit adds back the always_permitted_parameters configuration option to strong paramaters. * The initial pull requests where this feature was added are the following: - rails#12682 - rails/strong_parameters#174
Nice! 💃 |
# to change these is to specify `always_permitted_parameters` in your | ||
# config, e.g. | ||
# `config.always_permitted_parameters = %w( controller action format )` | ||
|
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.
✂️
We need to update the configuring guide and also make sure if you change this configuration adding a parameter it will not raise if the parameter is present. |
BTW, thank you for the patch. |
@rafaelfranca no problem. Quick questions:
Thanks! |
# because they are added by Rails and should be of no concern. One way | ||
# to change these is to specify `always_permitted_parameters` in your | ||
# config, e.g. | ||
# `config.always_permitted_parameters = %w( controller action format )` |
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.
Maybe we can do something like:
# config. For instance:
#
# config.always_permitted_parameters = %w( controller action format )
Thus we will have syntax highlighting and this reads a bit better. What do you think ? :-)
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.
Sure, will do that!
yes.
In the Action Pack section of https://github.com/rails/rails/blob/master/guides/source/configuring.md
Right now we only have test to make sure |
@rafaelfranca: Awesome! Thanks for the feedback. I will add those changes to the PR. |
* General style fixes. * Add changes to configuration guide. * Add missing tests.
@rafaelfranca What do you think? I added the changes and also one more test for the deprecation warning. |
Very good ❤️. I'll add a CHANGELOG entry and merge it. Thanks. |
Add always permitted parameters as a configurable option. [Rafael Mendonça França + Gary S. Weaver]
…D_PARAMS` `NEVER_UNPERMITTED_PARAMS` is deprecated in Rails 4.2. See rails#15933.