public static void done(long id) { Item item = Item.findById(id); if (item != null) item.delete(); index(); }
public static void addItem(Item item) { item.save(); index(); }
public static void listItems() { renderJSON(Item.findAll()); }
public static void index() { List<Item> currentItems = Item.all().fetch(); render(currentItems); }