how to use form to update the model stored in the session

  I am building a shopping_cart.Before the user proceed to check out,i
want the user to be able to modify the quantity for any cart_item,so
there is a quantity update function which is a rails form in the cart
1. cart information are kept in the session,cart are made of some
cart_items,every cart_item has title,price,quantity...attributes.
2. cart_item is not stored in the database,but there is cart_item
model,every cart_item object are made from the product object which has
corresponding model and table in the database.
   My problem: when i use form to update the quantity attributes for
some cart_item,the corresponding method can not output the expected
result, the quantity does not changed.Who can help me?The following are
my codes:
     <%=text_field :cart_item,:quantity,"size" => 10 -%>
     <%=submit_tag "recalculate"%>
def quantity_update
    #items is an array storing the cart_items
    if modified_item
     return @cart
def find_cart

who can help me?

Guo Yangguang wrote:

who can help me?

Could it be that in


the i is an integer, whereas params[:id] is a string.

A simple guess.