Skip to content

Instantly share code, notes, and snippets.

@sbrady
Last active August 29, 2015 14:13
Show Gist options
  • Save sbrady/35069a3d614179b1ddbc to your computer and use it in GitHub Desktop.
Save sbrady/35069a3d614179b1ddbc to your computer and use it in GitHub Desktop.
Give Grails more rails like RESTful routes
"/$controller"(parseRequest: true) {
action = [GET: "index", POST: "save"]
}
"/$controller/$id"(parseRequest: true) {
action = [GET: "show", PUT: "update", POST: "update", DELETE: "delete"]
constraints {
id matches: /\d+/
}
}
"/$controller/new"(parseRequest: true) {
action = [GET: "create"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment