Question

I created a new grails application using grails 2.3.7 and I removed the index action from the controller. My controller has static scaffold = true So now when I try to access applicationname/controller/index I get the list of objects which was shown by the list action in earlier versions of grails.

It has become confusing now, How do I redirect my applicationname/controller/ to some other action, because now I cannot do the following -

def index() {
redirect(action: someotheraction)
}
Was it helpful?

Solution

You can assign a value to the defaultAction property. See http://grails.org/doc/2.3.x/ref/Controllers/defaultAction.html.

I hope that helps.

OTHER TIPS

you can use following to keep the url same as applicationname/controller/ but still forward request to a different action


def index() {
forward(action: someotheraction)
}

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top