Ajax buttons in Rails

I have a form in a Rails/jQuery mobile app and I want it to do something like in Trajectory - when you click through 'Submit, ‘Deliver’, ‘Accept’ and the button changes text and color and the underlying form is updated. Any tips?