[Feature] [ActionPack] Add deep_transform_keys to ActionController::StrongParameters

56 views
Skip to first unread message

Gustavo Gutierrez

unread,
May 13, 2019, 6:48:57 AM5/13/19
to Ruby on Rails: Core
We are currently working with Rails API interacting with a frontend app. In order to simplify the interactions with the front app, we are supporting parameters and responses with camelCase.

When we were implementing this in the Rails API, we encountered that ActionController::StrongParameters implements transform_keys but it doesn't implements deep_transform_keys, as Hash does.
This would be a helpful feature for us because we use nested params for some requests, and we think it would also make the StrongParams API more similar to the Hash API. 

Any feedback on this would be very helpful. In AcidTango we have the intention to implement this feature if it is considered helpful.

Regards!

Rafael Mendonça França

unread,
May 13, 2019, 1:00:13 PM5/13/19
to Ruby on Rails: Core
👍 for this method.Can you open the PR?


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-co...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
Visit this group at https://groups.google.com/group/rubyonrails-core.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/9d0a3810-bf1d-405f-b788-6b840ba00c49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gustavo Gutierrez

unread,
May 14, 2019, 3:34:46 AM5/14/19
to Ruby on Rails: Core
Yes, will start working in a PR. 


El lunes, 13 de mayo de 2019, 19:00:13 (UTC+2), Rafael Mendonça França escribió:
👍 for this method.Can you open the PR?


On Mon, May 13, 2019 at 6:48 AM Gustavo Gutierrez <gus...@acidtango.com> wrote:
We are currently working with Rails API interacting with a frontend app. In order to simplify the interactions with the front app, we are supporting parameters and responses with camelCase.

When we were implementing this in the Rails API, we encountered that ActionController::StrongParameters implements transform_keys but it doesn't implements deep_transform_keys, as Hash does.
This would be a helpful feature for us because we use nested params for some requests, and we think it would also make the StrongParams API more similar to the Hash API. 

Any feedback on this would be very helpful. In AcidTango we have the intention to implement this feature if it is considered helpful.

Regards!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.

Gustavo Gutierrez

unread,
May 17, 2019, 2:21:12 PM5/17/19
to Ruby on Rails: Core
Opened the PR here.
Reply all
Reply to author
Forward
0 new messages