Oops - I hit Send before I meant to.
Anyway, the line of code you posted:
link('edit', array('action' => 'edit', 'id' =>
$compatible['Compatible']['id'], 'product_id' =>
$product['Product']['id']))?>
What line of HTML does it generate? I think you will find the URL
generated is not what you want.
You are going to have to post more of your code before we can help
more. What is on line 24 of edit.ctp? Show the entire edit() function
from your compatibles controller.
The line of code you supplied:
>link('edit', array('action' => 'edit', 'id' =>
$compatible['Compatible']['id'], 'product_id' =>
On Fri, Dec 18, 2009 at 12:13 PM, kdubya wrote:
> Try either:
> $this->redirect(array('controller' => 'compatibles', 'action' =>
> 'index', 'product_id:'.$product_id));
> which should result in a URL like:
> productsadmin/compatibles/index/product_id:3365
>
This would be the right address, but
On Dec 17, 3:30 pm, Dewayne Pinion wrote:
> Ok, apparently I am braindead, because I am still not grasping the concept
> of a redirect in cake. I have this page:
>
> productsadmin/compatibles/index/product_id:3365
Where does the above syntax come from (specifically the "product:3365"
part)? Ty
I'm in the same boat as Dewayne.
If you are on the edit page for that product and click submit doesnt
the product id get passed into the controller? If so then the
redirect specified
$this->redirect(array('controller' => 'compatibles', 'action' =>
'index',
'product_id' => $product_id));
should
Redirect does not redirect you to the previous page. If you don't have
the ID to the page you want to redirect to, then you cant redirect to
it.
You need to save that ID somewhere if you want to use it.
On Dec 17, 2:01 pm, Dewayne Pinion wrote:
> No luck so far. The http_referrer just stayed on
No luck so far. The http_referrer just stayed on the edit page. Using the
code below, I saw null. I did see in the code that I had $id instead, but
when I echoed it the id was the related product that I was editing, not the
main product page.
On Thu, Dec 17, 2009 at 4:48 PM, Andras Kende wrote:
try before the redirect:
echo 'product_id is: ' . $product_id;
die();
Andras
On Dec 17, 2009, at 4:42 PM, number9 wrote:
> In the past I have done that kind of redirect with this:
>
> $this->redirect($_SERVER['HTTP_REFERER']);
>
> Not 100% if that will work, but I seem to remember there being
In the past I have done that kind of redirect with this:
$this->redirect($_SERVER['HTTP_REFERER']);
Not 100% if that will work, but I seem to remember there being an
issue with redirecting after editing - perhaps the $product_id is
being lost?
On Dec 17, 8:30 pm, Dewayne Pinion wrote:
> Ok, app
Ok, apparently I am braindead, because I am still not grasping the concept
of a redirect in cake. I have this page:
productsadmin/compatibles/index/product_id:3365
That has an edit link. Clicking on it takes me to this page:
productsadmin/compatibles/edit/4228
where I can edit the informa
10 matches
Mail list logo