Search code examples
grailsgsp

Grails Ajax render to a GSP


I'm trying to use "render" to fill a div in my view with a gsp form. Below is the code in my Controller. When I trigger it in the view, it returns nothing (whitespace). But if I change the below code to use normal form elements ( , etc), it does indeed display them... Any thoughts on how I can rectify this?

render("""
<g:form name="editCommentForm" action="saveComments"> 
<g:textArea name="comments" value="comment" /> 
<g:submitToRemote update="editComments" />
</g:form>""" )

Solution

  • You can either create a template and render that, or use groovyPagesTemplateEngine.