Add edit/update functions in controller and views