Skip to content

Instantly share code, notes, and snippets.

@neokoenig
Created March 25, 2011 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neokoenig/886740 to your computer and use it in GitHub Desktop.
Save neokoenig/886740 to your computer and use it in GitHub Desktop.
<cffunction name="update">
<cfloop from=1 to="#arraylen(contact.emailaddresses)#" index="i">
<cfset contact.emailaddresses[i].delete()>
</cfloop>
<cfset contact.update(params.contact)>
<cfif contact.hasErrors()>
<cfset renderPage(action="edit")>
<cfelse>
<cfset flashInsert(success="The contact was updated successfully.")>
<cfset redirectTo(action="view", key=contact.id)>
</cfif>
</cffunction>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment