Simple example about how to work with jQuery UI draggable and ajax in the context of a Rails application.
Clone the repo in your local instance and run:
rake db:migrate rails s
And play with the images. Then refresh the page completely and you’ll see the images in the last place you left them.