# Problem with array

**URL:** <https://www.ruby-forum.com/t/problem-with-array/141620>\
**Category:** Ruby\
**Created:** [June 27, 2008, 8:37pm UTC](https://www.ruby-forum.com/t/problem-with-array/141620 "2008-06-27T20:37:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fernandoq](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/65b543/32.png) [@fernandoq](https://www.ruby-forum.com/u/fernandoq)\
**Post date:** [June 27, 2008, 8:37pm UTC](https://www.ruby-forum.com/t/problem-with-array/141620/1 "2008-06-27T20:37:22Z")

</div>

Hi everybody well still im a newbie in this of ruby but i try to do my  
best for can solve my problem but this time im stuck in this i hoe you  
can help me

IN A REDUCE WAY:  
how can i send the array that is write in the model for can manipulate  
it and can store in another table well any suggestion will be very  
helpfull

IN A LONG WAY:

Well the problem is that i use the example of agile web development for  
use the sessions in the shopping cart

So when i add or remove data in my session or my array , cause in the  
model i have write something like this:

attr\_reader :books

def initialize  
@books=[]  
end

def add\_tabla(tabla)  
current\_book=@books.find{|u| u==tabla}  
if current\_book  
@books.delete(current\_book)  
else  
@books\<\<tabla  
end  
end

so in @books (array) i have the data, so here it comes my problem, i  
need to send all the data stored in the array for another controller for  
store in a new table, i have a view:

\<% form\_tag :controller=\>‘table’,:action=\>‘send’,:id=\>@user.books do-%\>

# choosen books
 Title Autor CB

\<–! here is where i print on the view the data of the array in the  
model–\>

\<% for log in @user.books%\>

\<%=h(log.title)%\> \<%=h(log.autor)%\> \<%=h(log.codbar)%\> \<%end%\> \<%=link\_to\_close\_redbox "close"%\> \<%=submit\_tag 'Send'-%\> \<%end-%\>

What im trying to do is send the array to another control for can manage  
and store in a new table.

So how can i send in the correct way the array, cause when i read about  
params i can see that is a hash =S =S =S =S =S
