Forum: Ruby on Rails Rails Textbox question

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Terry D. (Guest)
on 2007-05-07 07:57
(Received via mailing list)
Hi All,

I have a table and in it is a cell like this:

      <%=text_field_tag 'quantity', line_item.quantity, {:size => 1} %>

So, when the page loads, this text box will contain the quantity value
of my

Down below, I give the user the option to change the quantity of the
item and then update their cart.

The link looks like this:

<%=link_to 'Update Quantity', :controller => 'cart', :action =>
'update_line_item_quantity', :new_quantity => quantity, :line_item_index
line_item_index %>

The :new_quantity => quantity part doesn't work.

What's the proper way to refer to the value of the contents of the text

Thanks for any help!

Terry (TAD) Donaghe
Zach I. // LT3media (Guest)
on 2007-05-07 09:29
(Received via mailing list)
Erm, you want to update link_to value with what's in the text box? If
so, that'll be AJAX.

Or if you mean, the pre-set quantity is @line_item.quantity

Zach I.
→ Blog —
→ Company —
→ Portfolio —
Terry D. (Guest)
on 2007-05-07 09:35
(Received via mailing list)
I'm trying to get it working with link_to_remote now... :)  I have a
problem, though because I'm adding multiple rows dynamically... almost
there, but time for bed.

On 5/6/07, Zach I. // LT3media <removed_email_address@domain.invalid> wrote:
> line_item_index %>
> >

Terry (TAD) Donaghe
This topic is locked and can not be replied to.