I would like to have a snippet html loaded in the action method of a controller. Is there a way to do this?
What I want to accomplish is actually have the Controller action use json as the format to return my response (with error codes and other information) and include a snippet of html loaded from a template file as one part of the json response.
My response would be something like:
{
errCode: 200,
myHtml: "Some html portion loaded from a template file goes here"
... more data elements..
}
The action would return the response with 'render (contentType: "text/json", data);