Step 7: Basic Grails data delete
Complete Application using Grails 3
Created by :
Grails
tutorial
Programming, Software and application
1095
2020-10-14 16:12:27
For delete, in the view page
{!! Form::open(['method' => 'DELETE','route' => ['contact.destroy', $contact->id],'style'=>'display:inline']) !!} {!! Form::submit('Delete', ['class' => 'btn btn-danger']) !!} {!! Form::close() !!}
And in the controller
$contact = Contact::findOrFail($id); $contact->delete(); return redirect()->back()->with('ok', 'Delete Success Message ');