grails - How do I get the controller and action from which a button was clicked? -


i working on project in there "add person" button appears on multiple pages redirects controller/view lets user fill out required fields , add new person database. however, stumped on how make redirect view called once new person has been added. if possible, retain user input existed on calling view when add person button clicked. here code adds person.

i need @ end of code.

redirect(controller: 'callingcontroller', action: 'callingaction') 

any help?

you need form

<g:form url="[resource:person, action:'addperson']" method="get" >    <label for="personname">    <span class="required-indicator">*</span> </label> <g:field name="personname" value="" required=""/>     <!-- put here fields details above-->  <fieldset class="buttons">    <g:actionsubmit class="save" action="addperson" value="add person" /> </fieldset> </g:form> 

you don't need redirect methods called ...


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -