fixed error on redirection in update action

This commit is contained in:
Parziphal 2013-12-01 21:27:23 -05:00
parent 2218817e42
commit e7771f8667

View File

@ -30,7 +30,7 @@ class AdvertisementsController extends ApplicationController
$this->ad = new Advertisement($this->params()->advertisement);
if ($this->ad->save()) {
$this->notice('Advertisement added');
$this->redirectTo(['#show', 'id' => $this->ad->id]);
$this->redirectTo($this->ad);
} else {
$this->render('blank');
}
@ -46,7 +46,7 @@ class AdvertisementsController extends ApplicationController
$this->ad = Advertisement::find($this->params()->id);
if ($this->ad->updateAttributes($this->params()->advertisement)) {
$this->notice('Advertisement updated');
$this->redirectTo(['#show', 'id' => $this->ad]);
$this->redirectTo($this->ad);
} else {
$this->render('blank');
}