Hy,
I\'m wondering what\'s the best way to create an Admin (backend) section in a Grails app ?
I want to create an \"Admin\" folder in the \"controllers\" f
Very late to this, but here is one way that might be useful, at least for a smaller application (I'm using Grails 2.0):
In conf/UrlMappings.groovy:
class UrlMappings {
static mappings = {
"/admin/$controller/$action?/$id?"{ constraints { // apply constraints here
} }
'/admin' (controller: 'yourMainController', action: 'list')
'/' (controller: 'public', action:'index')
// For the PublicController to handle *all* other requests (like /foo/bar/):
// '/**' (controller: 'public', action:'index')
"500"(view:'/error')
}
}
Note As you can see, this i not secured in any way.