So I’m using sortable_element to order a list. The problem I’m having
is that if I move two items in the list very quickly, I lose the
second move update because the backend doesn’t deal with the requests
in sequence. It updates the database for the second move first and
then over writes that with the first move.
Is there a simple solution to this problem. I’ve read about making the
requests synchronous rather than asynchronous, but that doesn’t seem a
good solution. I can’t be the only person to have come across this but
despite much googling I can’t find a good solution.
So it appears after a bit of reading the best method of dealing with
this problem, isn’t to deal with it directly.
It seems that providing feedback to the user (cursor into a wait state
or a showing a spinner) that something is happening is sufficient stop
them from doing other actions until it is completed. This seems rather
haphazard to me. For certain operations its fine, say when you’re
simply updating another pane with information, but becuase this is
actually updating the database and can cause the database to not
reflect what the user observes it doesn’t strike me a very good
solution at all.
Does anyone care to comment on this? Is a synchronous ajax request the
best way to go even though it locks the browser?
Thanks
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.