Forum: Ruby on Rails Rails Textbox question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A73f446eaaf56db0aeaa578aa373989b?d=identicon&s=25 Terry Donaghe (Guest)
on 2007-05-07 05:57
(Received via mailing list)
Hi All,

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

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

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

Down below, I give the user the option to change the quantity of the
line
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
box?

Thanks for any help!

--
Terry (TAD) Donaghe
http://tadspot.tumblr.com
Df4978da52459529e539da4c995918cb?d=identicon&s=25 Zach Inglis // LT3media (Guest)
on 2007-05-07 07: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 Inglis
→ Blog — http://www.zachinglis.com
→ Company — http://www.lt3media.com
→ Portfolio — http://portfolio.zachinglis.com
A73f446eaaf56db0aeaa578aa373989b?d=identicon&s=25 Terry Donaghe (Guest)
on 2007-05-07 07: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 Inglis // LT3media <lists@lt3media.com> wrote:
>
>
> line_item_index %>
> http://tadspot.tumblr.com
>
>
>
>
> >
>


--
Terry (TAD) Donaghe
http://tadspot.tumblr.com
This topic is locked and can not be replied to.