Is there planned support for permitting params one at a time vs. all at once in strong_parameters/Rails 4?

34 views
Skip to first unread message

Gary Weaver

unread,
Oct 3, 2012, 2:46:21 PM10/3/12
to rubyonra...@googlegroups.com
Was going to have a variety of request params sent in and use a class_attribute that would define types of request parameters that are allowed. strong_parameters wouldn't be too much trouble in such a case if it would allow me to manually permit some attributes (dynamically determined) in the controller but allow strong_parameters to enforce security of others.

Is this something that has been discussed before that someone could point me to or is this something under consideration?

Gary Weaver

unread,
Oct 3, 2012, 3:15:10 PM10/3/12
to rubyonra...@googlegroups.com
Actually this probably won't affect us as I thought earlier, but am still curious if permit might eventually support one at a time definition instead of all at once. Thanks!

Jesse Wolgamott

unread,
Oct 3, 2012, 4:07:08 PM10/3/12
to rubyonra...@googlegroups.com
Yes, strong_parameters can be dynamic --- there was a slight gotcha on the permits for strong_parameters, so I created a gist example showing how it can happen (delegating out to the Post model in this case).

There's also no reason you couldn't continue to use remove a subset of parameters in your controller.


==========================
Jesse Wolgamott @ Comal Productions, LLC.
Web. Mobile. Design. Training.
@jwo

On Wednesday, October 3, 2012 at 2:15 PM, Gary Weaver wrote:

Actually this probably won't affect us as I thought earlier, but am still curious if permit might eventually support one at a time definition instead of all at once. Thanks!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/dSYM4-P8GkkJ.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-co...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.

Reply all
Reply to author
Forward
0 new messages