public static void index() { if (Gallery.count() > 0) { Gallery defaultGallery = Gallery.all().first(); showGallery(defaultGallery.id, defaultGallery.name); } else { render(); } }
@Util public static List<Gallery> getGalleries() { return Gallery.all().fetch(); }