public static Result newTask() { Form<Task> filledForm = taskForm.bindFromRequest(); if (filledForm.hasErrors()) return badRequest(views.html.task.render(Task.all(), filledForm)); else { Task.createTask(filledForm.get()); return redirect(routes.Application.getTasks()); } }
public static Result deleteTask(Long id) { Task.delete(id); return redirect(routes.Application.getTasks()); }