What may cause request parameters to appear as nested parameters

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

What may cause request parameters to appear as nested parameters

fugee ohu
Here my params are nested utf8 wraps press_release which in turn wraps venue, venue_country, etc.
What causes this behavior?

{"utf8"=>"✓",
 "authenticity_token"=>"qR82bEuyDUS6XD1dxylozc96nGH0kxk/ew+sUe95LT9s+8G9PJqAr06khj0bE9SEPElcinsWxe0Kgzppzq1g0w==",
 "press_release"=>
  {"venue"=>"",
   "venue_country"=>"US",

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" 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].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3538a0ba-4671-4fca-99b5-7d56583b39d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: What may cause request parameters to appear as nested parameters

Walter Lee Davis
utf8 and authenticity_token are at the "root" level of the params hash, at the same level as press_release. They are peers. Press release contains two child attributes and their values, because that's the way your form was set up. By default, when you use

        <%= form_for @foo do | f | %>

to start off your form, you are going to get a set of parameters like

        { ... "foo" => { "name" => "Bar", "style" => "Baz" } ... }

in return.

Walter

> On Apr 20, 2017, at 6:00 AM, fugee ohu <[hidden email]> wrote:
>
> Here my params are nested utf8 wraps press_release which in turn wraps venue, venue_country, etc.
> What causes this behavior?
>
> {"utf8"=>"✓",
>  "authenticity_token"=>"qR82bEuyDUS6XD1dxylozc96nGH0kxk/ew+sUe95LT9s+8G9PJqAr06khj0bE9SEPElcinsWxe0Kgzppzq1g0w==",
>  "press_release"=>
>   {"venue"=>"",
>    "venue_country"=>"US",
>
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" 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].
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3538a0ba-4671-4fca-99b5-7d56583b39d8%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: Talk" 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].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/98CE44A0-21B1-44E2-BF7E-D1174C245A7A%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: What may cause request parameters to appear as nested parameters

fugee ohu


On Thursday, April 20, 2017 at 8:05:00 AM UTC-4, Walter Lee Davis wrote:
utf8 and authenticity_token are at the "root" level of the params hash, at the same level as press_release. They are peers. Press release contains two child attributes and their values, because that's the way your form was set up. By default, when you use

        <%= form_for @foo do | f | %>

to start off your form, you are going to get a set of parameters like

        { ... "foo" => { "name" => "Bar", "style" => "Baz" } ... }

in return.

Walter

> On Apr 20, 2017, at 6:00 AM, fugee ohu <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ZvgsszmnBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...> wrote:
>
> Here my params are nested utf8 wraps press_release which in turn wraps venue, venue_country, etc.
> What causes this behavior?
>
> {"utf8"=>"✓",
>  "authenticity_token"=>"qR82bEuyDUS6XD1dxylozc96nGH0kxk/ew+sUe95LT9s+8G9PJqAr06khj0bE9SEPElcinsWxe0Kgzppzq1g0w==",
>  "press_release"=>
>   {"venue"=>"",
>    "venue_country"=>"US",
>
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ZvgsszmnBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ZvgsszmnBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
> To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/3538a0ba-4671-4fca-99b5-7d56583b39d8%40googlegroups.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/3538a0ba-4671-4fca-99b5-7d56583b39d8%40googlegroups.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/3538a0ba-4671-4fca-99b5-7d56583b39d8%40googlegroups.com&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/3538a0ba-4671-4fca-99b5-7d56583b39d8%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.


Thanks 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" 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].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/65e120b7-90c5-4472-9ef8-391a6e997e71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...