After order a HTML with JQuery UI Drag and Drop, save ordered table to DB using Rails

Hi guys

I’m doing a form with fields like name, email, phone, address, city,
state, etc.

Each field has a table in db.

I will use state field as an example:

In db I had table states with columns: position, name and acronym

In my View I had a HTML table with name and acronym, ordered by position
(when page loads). I can order my table using select box (order by name
or acronym) or using drag and drop.

How could I save my “new table” to db when i click Save button?