⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

going to edit after insert



carlok

carlok
  • profile picture
  • Member

Posted 04 May 2013 - 18:03 PM

Hello,

after a successfully insert, I'd like to go to the edit page of the new record (when I update a record, after a successfully update, the form stay filled on the given record page): I can get the primary_key of it using callback_after_insert but a redirect inside the function of the callback does not redirect at all.

 

What is the correct "grocerycrud way" to edit a record just after having successfully inserted it?

 

Thanks.


DREON

DREON
  • profile picture
  • Member

Posted 06 May 2013 - 00:43 AM

try to read this hope you get idea on how to redirect:

 

/topic/1631-one-click-update/


davidoster

davidoster
  • profile picture
  • Member

Posted 07 May 2013 - 07:51 AM

You need to call a controller function passing the id of the record that has just being inserted and add a where

$crud->where('id', $id);