# Array mangled from view to controller

**URL:** <https://www.ruby-forum.com/t/array-mangled-from-view-to-controller/147126>\
**Category:** Rails\
**Created:** [August 28, 2008, 5:26pm UTC](https://www.ruby-forum.com/t/array-mangled-from-view-to-controller/147126 "2008-08-28T17:26:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [August 28, 2008, 5:26pm UTC](https://www.ruby-forum.com/t/array-mangled-from-view-to-controller/147126/1 "2008-08-28T17:26:24Z")

</div>

Hi,

Ruby 1.8.6  
Rails 1.2.6

I have a simple @conditions variable setup in a controller’s “list”  
method. It looks something like:

[“abbr = ? and (start\_date between ? and ?)”, “AZ”, ‘2008-08-01’,  
‘2008-08-31’]

From any given view, I pass that variable back to the “export” method  
if they want to export a list of records to a CSV file:

link\_to(  
image\_tag(‘export.png’, :alt =\> ‘Export to CSV file’),  
:action =\> ‘export’,  
:conditions =\> @conditions  
)

What I’ve noticed, however, is that it sometimes mangles the array and  
the order of the array, and I end up with:

[“2008-08-01”, “2008-08-31”, “AZ”, “abbr = ? and (start\_date between ?  
and ?)”]

I’m definitely not altered the array myself, and it doesn’t always  
happen, either. I’m completely baffled by this. What’s happening?

Thanks,

Dan
