I have tried Ruby (and Rails) earlier and when I created the views I used a syntax like this in the input fields:
<input name="fruit[name]" .../>
<input name="fruit[traits][]" .../>
and so on. The first one would give me a fruitkey in the params hash and so on. Now that I have shifted to Node.js and Express I can use the same syntax in the name attribute and I get a nice object fruit in the request objects body property (using the bodyParser middelware).
Now I wonder, is it written in the spec that the given formats in the name attribute should create such a structure in the request params/body property? Or is this something that everyone just do?
Now I wonder, is it written in the spec that the given formats in the name attribute should create such a structure in the request params/body property?
No
Or is this something that everyone just do?
It started in PHP. A few other form parsers have copied the behaviour.