Hi,

I'm trying to create a simple chess game in Rails.  Each square on the
board is a div with its own id.  Pieces are images.

I assign a CSS class to squares based on whether they are empty (they
can accept a piece of either color) or they have a piece image inside
the div (they can only accept a piece of the opposite color for
capturing purposes).

Moving pieces to empty squares works fine.  Moving pieces to capturing
squares works fine.  In both cases my controller action is called
because the drop "worked" and I update my internal knowledge of the
board position.

But moving a piece to a div that does not have an acceptable class
element does not revert the piece back to where it came from.  Indeed
I can move a piece "off the board" into the surrounding <body> element
and the piece sticks there, instead of reverting to its original
place.

Any idea how to get the <%= drop_receiving_element ....%> l to revert
the drag if it lands on a div without an acceptable CSS class?

Thanks!
Jeff
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to