To send the appropriate response, I need to determine if the controller action was requested using the classic HTTP GET request, AJAX request, or g: include tag lib .
For example, given the following snippet code:
class CommunityController {
def show = {
def users = getUsers()
if ()
render template:'show', model=[users]
else if (request.xhr)
render users as JSON
else
[users]
}
}
... how can I detect that the action was invoked through g: include tag lib?
Thank.
source
share