# What's the history of Rails' json structure?

**URL:** <https://metaruby.com/t/whats-the-history-of-rails-json-structure/674>\
**Category:** Rails Forum\
**Created:** [September 13, 2016, 3:53pm UTC](https://metaruby.com/t/whats-the-history-of-rails-json-structure/674 "2016-09-13T15:53:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjb](https://metaruby.com/user_avatar/metaruby.com/jjb/32/843_2.png) [@jjb](https://metaruby.com/u/jjb)\
**Post date:** [September 13, 2016, 3:53pm UTC](https://metaruby.com/t/whats-the-history-of-rails-json-structure/674/1 "2016-09-13T15:53:27Z")

</div>

By default, when generating a widget scaffold, rails will send JSON down in a GET request like this:

```
{"name": "foo", "size": 5}

```

But will expect it sent up in a PATCH request like this:

```
{"widget": {"name": "foo", "size": 5}}

```

Anyone know the history/rational behind this?

---

<div class="post-metadata">

**Author:** ![danielpclark](https://metaruby.com/user_avatar/metaruby.com/danielpclark/32/823_2.png) [@danielpclark](https://metaruby.com/u/danielpclark)\
**Post date:** [September 13, 2016, 6:54pm UTC](https://metaruby.com/t/whats-the-history-of-rails-json-structure/674/2 "2016-09-13T18:54:45Z")

</div>

With standard form methods the attributes are placed under the object kind. If you want to declare the param specifically - generally use the method `_tag` helpers which will have you explicitly declare the full params nesting.
