Rails Textbox question

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

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 — http://www.zachinglis.com
→ Company — http://www.lt3media.com
→ Portfolio — http://portfolio.zachinglis.com

I’m trying to get it working with link_to_remote now… :slight_smile: 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 [email protected] wrote:

line_item_index %>

Terry (TAD) Donaghe

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs