how to prevent URL change

Hello,

FYI, you will need to use redirect_to in conjunction with AJAX to
ensure that you are backwards compatible with non-javascript enabled
browsers.

So, for example:

def increment
  ...
  redirect_to :action => :edit unless request.xhr?
end

This would fire the edit action fire and display edit view after
increment is executed. This would ensure that the URL does not change.

Additionally, you would have a view called increment.rjs which is the
ruby-javascript code to update the DOM for the AJAX side of things.

Regards,
Jason Arora