Created
January 23, 2012 15:20
-
-
Save mathieuancelin/1663684 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Application extends Controller { | |
public static void index() { | |
List tasks = Task.find("order by id desc").fetch(); | |
render(tasks); | |
} | |
public static void createTask(String title) { | |
Task task = new Task(title).save(); | |
renderJSON(task); | |
} | |
public static void updateTask(Long id, boolean done) { | |
Task task = Task.findById(id); | |
task.done = done; | |
task.save(); | |
renderJSON(task); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment