Пример #1
0
 @SecureAdmin
 public static void create(Long forumId, @Required String subject, String content) {
   if (validation.hasErrors()) {
     validation.keep();
     params.flash();
     flash.error("Please correct these errors !");
     post(forumId);
   }
   Forum forum = Forum.findById(forumId);
   notFoundIfNull(forum);
   Topic newTopic = forum.newTopic(connectedUser(), subject, content);
   show(forumId, newTopic.id, null);
 }
Пример #2
0
 @SecureAdmin
 public static void post(Long forumId) {
   Forum forum = Forum.findById(forumId);
   notFoundIfNull(forum);
   render(forum);
 }