I solved this by adding a

post "products/add_to_cart"

to the routes.rb

-Dan

On Dec 24, 1:37 am, Dan Sadaka <[email protected]> wrote:
> Greetings,
>
> I asked this over at the Spree google group but got no response.  I'm
> hoping someone here might have experience with this.
>
> I am implementing a drag and drop cart with Rails 3 and jQuery.  This
> cart works outside of Spree.
>
> The URL I call from the drop action is hardcoded as
> /products/add_to_cart.js.
>
> I also added an Add To Cart button that uses the new :remote => true
>
> <%= form_tag url_for(:action => 'add_to_cart', :id => domid), :id =>
> "add-to-cart-form", :remote => true do %>
>         <%= submit_tag "Add to Order" %>
> <% end %>
>
> This works!  the add_to_cart method fires and understands I want a JS
> response.  However, the problem still occurs when I try to drag and
> drop.  Of course, I can't (don't know how) to use the rails remote
> helper inside of the javascript so I am "hardcoding" the call to /
> products/add_to_cart.js.
>
> So, rails is recognizing JS when done from a remote form but not by
> passing the .js extension.  What do I need to do to get it to
> recognize this?  Or, is there a better way?
>
> TIA,
> Dan
>
> --
> Posted viahttp://www.ruby-forum.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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to