Having tried the standard Rails scaffold and now the new Streamlined scaffold, I feel like I’m back to square one in terms of designing the interaction model for my app. It seems it all boils down to how one handles handles list / show / edit, in particular where AJAX edit in place is possible and where it isn’t. There are only a few combinations possible, but unfortunately both the standard Rail scaffold as well as Streamlined only implement one of them, so it makes it difficult to move stuff around or to build an app that uses more than one model of interaction.
The standard Rails scaffold doesn’t use AJAX at all. It’s model is as follows:
- List - Table with 1 row per object, buttons for show / edit / delete per row, new (create) button at end of table
- Show - Table with 1 row per attribute, buttons for back and edit at the bottom
- Edit - Form table similar to show, but with editable forms, buttons for save and cancel at the bottom
- List - Table with 1 row per object, buttons for show / edit / delete per row, new button at end of table
- Show - Pop-up table with 1 row per attribute, edit button at end, and “window” close/minimize/maximize buttons in the pop-up window title bar
- Edit - Uses same pop-up window as show and transition between show and edit is smooth (but does require server request), buttons for save and show at the bottom.
The ajax scaffold seems to be similar to Streamlined in that it operates entirely out of the list view. I haven’t tried it, so I’m not 100% sure. From what I can gather it operates as follows:
- List - Table with 1 row per object, buttons to edit and delete, button for new (create) at the top.
- Show - no such view, it’s all shown in the list table
- Edit - Creates an in-place form by increasing the (vertical size of the row and placing a form into the row with buttons for save and cancel.
- List - Table with 1 row per object, showing only selected attributes, click on row to show, button at top for new
- Show - Page with 1 row per attribute, click on any attribute to switch to edit, button at top for delete
- Edit - Seamless in-place transition between show and edit, buttons for save and cancel at the bottom
- List - There is no list view for a relationship on its own, but there is a list partial that can be included in a cell in the list view of either of the entities being related
- Show - There is no show view for a relationship on its own, but there is a show partial that is included in the show view of either of the entities being related. The show partial is really more like a list view in that it shows a table with one row per relationship.
- Edit - Again, there is no edit view for a relationship on its own, but there is an edit partial very similar to the show partial that is intended to be included in the edit view of either of the entities being related. The edit partial allows inline editing of the relationship attributes, and it has a delete button for each row. At the bottom it has a drop-down select box to add new relationships.