예제 #1
0
 public static void done(long id) {
   Item item = Item.findById(id);
   if (item != null) item.delete();
   index();
 }
예제 #2
0
 public static void addItem(Item item) {
   item.save();
   index();
 }
예제 #3
0
 public static void listItems() {
   renderJSON(Item.findAll());
 }
예제 #4
0
  public static void index() {

    List<Item> currentItems = Item.all().fetch();

    render(currentItems);
  }