I'm using RJS to add and remove rows from a list of items. Ideally,
when the list is empty, there should be a single row "You have no
items", otherwise the list looks confusing with the header but no
items. Does anyone have a recipe for doing this?
1. Update add and remove RJS templates to query the DB to get the item
count, and remove/add the special row as necessary. Has concurrency
2. When the page is initialized, put the display item count into the
session, and update add/remove actions to keep it up-to-date. Update
RJS templates as per option 1.
iterates over its children, inserting the "You have no items" row if
I'm leaning towards option 2, but if there is a cleaner approach that
would be awesome.