Possible Duplicate:
Grails populating a domain instance
I am wanting to pass a childInstance object from my view to the controller at the moment I am doing this
<g:formRemote url="[action: 'updateStatus']" update="messages" name="updateStatusForm" onSuccess="document.updateStatusForm.message.value='';">
the updateStatus method is as follows
def updateStatus(String message) {
def status = new Post(message: params.message, author: lookupPerson())
System.out.println("status: " + status.message + " : " + status.author)
status.save(flush: true, failOnError: true)
def messages = currentUserTimeline()
render template: 'profileMessages', collection: messages, var: 'profileMessage'
}
I want to add a childInstance from my view to the updateStatus. But I also want to to work if I don’t pass the childInstance to the update Status.
I hope this makes sense.
Add this to the url
and call it in your controller method with