TvE 2100

At 2100 feet above Santa Barbara

Rails List / Show / Edit Variations

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
Streamlined takes a different approach and basically operates entirely from within the list view. Show and edit are handled within pop-up layers:
  • 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.
A nice aspect of the streamlined show/edit pop-up windows is that it is possible to show multiple elements at the same time.

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.
The mode I’d like to have at the moment is different from the above. The primary reason is that I have a lot of information for each object, including images, thus maing it impractical to show everything in a list view. What I’d like is:
  • 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
The second reason I’d like to have a full page for show, instead of the pop-up that Streamlined creates, is that I have a bunch of many-to-many relationships for which I’m still trying to find a good editing model. I am not using the Rail HABTM at all and am instead creating explicit models for the relationships because each of these relationships has attributes on its own. What I’d like to happen with these relationships in the views of the entities that are being related is the following:
  • 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.
Ok, I really need to add some pictures to explain this. But actually the real point I want to make is not that the way I’d like to structure the list / show / edit interaction is better, but that I need the flexibility. So what I’d like is the scaffold to offer more flexibility and generate more possibilities for me: don’t try to lock me into one interation model. Either give me a bunch of options to pass to the generator ot generate a whole bunch of partials that I can combine in different ways.