I'm trying to call the index action and keep calling the count action and i don't know why. This is the code in the urlmapping
group "/api/product",{
"?"(controller: 'product', action: 'save', method: 'POST')
"?"(controller: 'product', action: 'index', method: 'GET')
"/$id?"(controller: 'product', action: 'delete', method: 'DELETE')
"/$id?"(controller: 'product', action: 'update', method: 'PUT')
"/$id?"(controller: 'product', action: 'show', method: 'GET')
"/count?"(controller: 'product', action: 'count', method: 'GET')
}
Try the following mappings:
"/api/product/count"(controller:"product")
{
action = [GET:"count"]
}
"/api/product/$id"( controller:"product")
{
action = [GET: "show", PUT:"update",DELETE:"delete"]
}
"/api/product"( controller:"product")
{
action = [GET: "index", POST:"save"]
}