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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Gustavo Gutierrez
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 [hidden email].
To post to this group, send email to [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

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

Rafael Mendonça França
👍 for this method.Can you open the PR?


On Mon, May 13, 2019 at 6:48 AM Gustavo Gutierrez <[hidden email]> 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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAC9YFze_yKqgoOF%3D%2BxUJ%2BmBDX03CqYXruNBQwSFbHT85ZwKgYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

Gustavo Gutierrez
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?
Rafael Mendonça França
<a href="http://twitter.com/rafaelfranca" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftwitter.com%2Frafaelfranca\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFTNo97InMQZl9c9YwNzZuJ4peZdA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftwitter.com%2Frafaelfranca\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFTNo97InMQZl9c9YwNzZuJ4peZdA&#39;;return true;">http://twitter.com/rafaelfranca
<a href="https://github.com/rafaelfranca" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Frafaelfranca\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHuv1sgZ_l3Gn7v8NRNZXMgLLGbdA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Frafaelfranca\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHuv1sgZ_l3Gn7v8NRNZXMgLLGbdA&#39;;return true;">https://github.com/rafaelfranca


On Mon, May 13, 2019 at 6:48 AM Gustavo Gutierrez <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="FocIN9zaAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">gus...@...> 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="FocIN9zaAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="FocIN9zaAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
Visit this group at <a href="https://groups.google.com/group/rubyonrails-core" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/rubyonrails-core&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/rubyonrails-core&#39;;return true;">https://groups.google.com/group/rubyonrails-core.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-core/9d0a3810-bf1d-405f-b788-6b840ba00c49%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-core/9d0a3810-bf1d-405f-b788-6b840ba00c49%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-core/9d0a3810-bf1d-405f-b788-6b840ba00c49%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-core/9d0a3810-bf1d-405f-b788-6b840ba00c49%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/a931c777-729a-4bf4-9dd1-04a7e25a88fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

Gustavo Gutierrez
Opened the PR here.
El martes, 14 de mayo de 2019, 9:34:46 (UTC+2), Gustavo Gutierrez escribió:
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?
Rafael Mendonça França
<a href="http://twitter.com/rafaelfranca" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftwitter.com%2Frafaelfranca\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFTNo97InMQZl9c9YwNzZuJ4peZdA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftwitter.com%2Frafaelfranca\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFTNo97InMQZl9c9YwNzZuJ4peZdA&#39;;return true;">http://twitter.com/rafaelfranca
<a href="https://github.com/rafaelfranca" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Frafaelfranca\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHuv1sgZ_l3Gn7v8NRNZXMgLLGbdA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Frafaelfranca\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHuv1sgZ_l3Gn7v8NRNZXMgLLGbdA&#39;;return true;">https://github.com/rafaelfranca


On Mon, May 13, 2019 at 6:48 AM Gustavo Gutierrez <[hidden email]> 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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at <a href="https://groups.google.com/group/rubyonrails-core" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/group/rubyonrails-core&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/rubyonrails-core&#39;;return true;">https://groups.google.com/group/rubyonrails-core.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-core/9d0a3810-bf1d-405f-b788-6b840ba00c49%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-core/9d0a3810-bf1d-405f-b788-6b840ba00c49%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-core/9d0a3810-bf1d-405f-b788-6b840ba00c49%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-core/9d0a3810-bf1d-405f-b788-6b840ba00c49%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/d54f75b5-f1e4-4ba6-b18e-9b72173c2c59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.