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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
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 On May 6, 2007, at 10:49 PM, Terry Donaghe wrote:> 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 > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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-w8tEHcFK2X5Wk0Htik3J/w@public.gmane.org> wrote:> > 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 > > > > On May 6, 2007, at 10:49 PM, Terry Donaghe wrote: > > 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 > > > > > > >-- Terry (TAD) Donaghe http://tadspot.tumblr.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---