Is it possible to add a URL mapping that includes controller/action/id? Example:
URL:
localhost:8080/myproject/book/scifi/dune
localhost:8080/myproject/book/scifi/walking+dead
new URL:
localhost:8080/myproject/dune
localhost:8080/myproject/walking_dead
I tried:
static mappings = {
"/books" (controller: "book", action: "scifi", id: "dune")
"/walking_dead" (controller: "book", action: "scifi", id: "walking+dead")
}
Doesn’t seem to work. Basically our client want specific URLS, I was using ids, then changed it to names as the ids. But now the client wants unique URLs. THanks for any help or insight.
and the value is available as params.bookId in the controller