Hello all.
I have the following Code in a view:
<% @dishes.each do |dish| -%>
<tr>
<td><%= link_to dish.name, :controller => "restaurant",
:action =>
"show_dish", :id =>"#{dish.id}" -%>
<% if dish.vegetarian? -%>
<%= image_tag("/images/vegetarian.gif", :class =>
"bevel", :size =>
"8x8") %></td>
<% end -%>
<td><%=h dish.summary -%></td>
<td><%=h dish.price -%></td>
<%= form_tag :action => :add_to_trolley -%>
<td><%= hidden_field_tag("id", "#{dish.id}")
-%><%=
text_field_tag("fresh","", :size => "2", :value
=> "0" ) -%> <%=
text_field_tag("frozen","", :size => "2",
:value => "0") -%></td>
<td><%= submit_tag("Order") -%></td>
<% end_form_tag -%>
<% end -%>
The idea is to present the user with a list of orderlines with an
"Order" button at the end of each line. They fill in the
"Fresh" and
"Frozen" values for a line and hit that line''s order button.
What appears to be happening is that the submit button for every line
tries to submit the data in the "Fresh" and "Frozen" values
for the
first line ONLY instead of the line in which the order button is part
of. Can anyone see why?
Thanks
Jeff
--
Posted via http://www.ruby-forum.com/.