How to remove "delete" button in default "Edit" form of sonata admin?

user1548055 picture user1548055 · Jul 24, 2012 · Viewed 8.4k times · Source

I wrote a code to list data taken from a simple database and there I put an action to edit data. When I click on this Edit button, it goes to the default "Edit" page. There is a button called "delete" there. I want to remove that button...

Answer

chemalarrea picture chemalarrea · Sep 19, 2012

In your EntityAdmin class add following

public function configureRoutes(RouteCollection $collection)
{
  $collection->remove('create');
}