Topic: Rails form_for remote

Hi everyone, i have a problem that is making me pull my hair out and i dont know how to resolve it, I have the following view code:

  <td><%= line_item.product.title %></td>
  <td class="item_price" ><%= number_to_currency(line_item.total_price) %></td>
    <%= form_for(line_item, :remote => true)  do |f| %>
        <td><%= f.text_field :quantity, :size => 1 %><%= f.submit :value => "update Qty" %></td>
     <% end %>
  <td><%= button_to 'Delete Line Item', line_item, :method => :delete, :remote => true %></td>

and i get the following output:

Started POST "/line_items/36" for at 2011-03-30 20:48:36 +0100

ActionController::RoutingError (No route matches "/line_items/36"):

Rendered /Users/sarndeepnijjar/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.5/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.7ms)

when i remove the :remote => true from the form_for everything works when I update the quantity, it looks like the request is parsed to my LineItems controller.

what is it that im missing?

Last edited by Linux_cat (2011-03-30 15:52:18)

Re: Rails form_for remote

no one has any pearls of wisdom?