Hi, I am brand new to Rails and I love it, but I am stuck on something
I just can't figure out.
I have table in my database of Pages which are listed in the admin
view in an HTML table.
Each page has
ID
Title
Content
Page_order
The HTML table displays:
Title
Page_order
The HTML table has some jQuery attached to it that allows me to sort
the rows up and down, and then updates the text inside the Page_order
table cells to be in numerical order. In other words:
Why not defer making changes at the DB level until the person is done
with the page. Ye olde Save or Cancel (or just navigate away).
An Ajax request and DB update per "fiddle" with a row seems overdone to
me, but if your interface doesn't use an explicit "save" button or
something similar, then it could work.
As for the Ajax part, I haven't ventured there myself yet.
Well I'm trying to do it from the list action, so there is no save
button, though I could do that. It's not a bad idea. Maybe enable/
reveal a link_to or button_to after a change is made?