# Passing an array List of Object

**URL:** <https://www.ruby-forum.com/t/passing-an-array-list-of-object/153446>\
**Category:** Rails\
**Created:** [November 17, 2008, 10:51am UTC](https://www.ruby-forum.com/t/passing-an-array-list-of-object/153446 "2008-11-17T10:51:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 17, 2008, 10:51am UTC](https://www.ruby-forum.com/t/passing-an-array-list-of-object/153446/1 "2008-11-17T10:51:35Z")

</div>

Hi friends,

I’m trying to pass an Array list of Objects that I have captured on  
the fly after querying a web service. I have the array list available  
with me. Now, the issue that I’m facing is that I would want to pass  
the Array List of objects to another action defined in my controller.  
Whenever I’m using the redirect\_to function, The Array List is being  
treated as String and I’m not able to manipulate (sort, paginate…)  
the object list. Presently what I’m doing is I’m placing the Array  
List in a session variable and performing the manipulations. However,  
this is impacting the speed of program execution. I would really  
appreciate any help from you guys.

To give you guys a feel of things…

# ================ Controller Code::

def create\_obj\_list

#=================================================  
#Code for initializing the call to the web service by calling the  
Lib files  
#=================================================  
@new\_arr=[]  
request=GetObjectsByCallingFunction(param0,param1)  
response=ObjectType.new  
response=getTheObjectListCall(request)  
response.each{ |arr  
@new\_arr\<\<arr  
}

#=================================================  
#This is where I’m trying to pass the Object list  
#=================================================

redirect\_to :action=\>‘passed\_obj\_list’, :value=\>@new\_arr

end

def passed\_obj\_list  
@arr\_for\_manipulation=[]  
@arr\_for\_manipulation=params[:value] #=\> This is being treated as a  
String… No Objects are available…

#=================================================

# Code for Manipulation

#=================================================

end

Hope to hear from you soon…

with warm regards,

Chandragupta

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 26, 2008, 10:28am UTC](https://www.ruby-forum.com/t/passing-an-array-list-of-object/153446/2 "2008-11-26T10:28:39Z")

</div>

I guess there is no solution to this problem…

On Nov 17, 12:20 pm, “removed\_email\_address@domain.invalid”
