# Post method or request flattening array of hashes in params

**URL:** <https://www.ruby-forum.com/t/post-method-or-request-flattening-array-of-hashes-in-params/180554>\
**Category:** Rails\
**Created:** [December 21, 2009, 6:35pm UTC](https://www.ruby-forum.com/t/post-method-or-request-flattening-array-of-hashes-in-params/180554 "2009-12-21T18:35:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![biot023](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/7ab992/32.png) [@biot023](https://www.ruby-forum.com/u/biot023)\
**Post date:** [December 21, 2009, 6:35pm UTC](https://www.ruby-forum.com/t/post-method-or-request-flattening-array-of-hashes-in-params/180554/1 "2009-12-21T18:35:10Z")

</div>

Hi – I have the following code in a cucumber feature:  
[http://pastie.org/752061](http://pastie.org/752061)  
The problem is that the post method (or the controller) is flattening  
the array of hashes into an array containing all the key-value pairs in  
one hash, like so: [http://pastie.org/752067](http://pastie.org/752067)  
(Obtained from a call to inspect on params[:upload\_data] in the  
controller.)

I also call the post action from a controller spec with this code, which  
is basically identical: [http://pastie.org/752070](http://pastie.org/752070)  
This treats the params correctly, and the inspection from this is:  
[http://pastie.org/752079](http://pastie.org/752079)

This is very weird!  
I’m using the latest stable version of Rails, and Ruby 1.9.1  
Can anyone shed any light on what may be going wrong, here?  
Thanks,  
Doug.
