I'm building my first custom e-comm application in rails. My catalog
listings are a few directories down from the index page, arrived at
through various sub-category selection. After adding a product to the
cart, I want to redirect to the current url instead of the index. I
don't quite know how to do this. I seems to me that I have to capture
the current url and pass it to the controller action, then redirect to
it. But I could be way off.
On Mon, Mar 17, 2008 at 12:39 PM, Carson <E.CarsonCampb...@gmail.com> wrote:
> I'm building my first custom e-comm application in rails. My catalog > listings are a few directories down from the index page, arrived at > through various sub-category selection. After adding a product to the > cart, I want to redirect to the current url instead of the index. I > don't quite know how to do this. I seems to me that I have to capture > the current url and pass it to the controller action, then redirect to > it. But I could be way off.
> Any advice?
> Regards,
> Carson
-- Mark Van Holstyn, Partner / Software Developer mvanhols...@mutuallyhuman.com, (616) 706-6842 Mutually Human Software, http://mutuallyhuman.com
Carson, I don't know the answer, but I wonder if you might find it in
Chpt 2 of the excellent The Rails Way.
Ch 2 explains all about the dispatcher, and at p 39 it goes to some
depth about redirecting.
Ed
Carson wrote:
I'm building my first custom e-comm application in rails. My catalog
listings are a few directories down from the index page, arrived at
through various sub-category selection. After adding a product to the
cart, I want to redirect to the current url instead of the index. I
don't quite know how to do this. I seems to me that I have to capture
the current url and pass it to the controller action, then redirect to
it. But I could be way off.
Any advice?
Regards,
Carson
> redirect_to :back if you want to go back to the last url you were at, not
> sure if that is what you are asking though...
> Mark
> On Mon, Mar 17, 2008 at 12:39 PM, Carson <E.CarsonCampb...@gmail.com> wrote:
> > I'm building my first custom e-comm application in rails. My catalog
> > listings are a few directories down from the index page, arrived at
> > through various sub-category selection. After adding a product to the
> > cart, I want to redirect to the current url instead of the index. I
> > don't quite know how to do this. I seems to me that I have to capture
> > the current url and pass it to the controller action, then redirect to
> > it. But I could be way off.
> > Any advice?
> > Regards,
> > Carson
> --
> Mark Van Holstyn, Partner / Software Developer
> mvanhols...@mutuallyhuman.com, (616) 706-6842
> Mutually Human Software,http://mutuallyhuman.com- Hide quoted text -
Thanks for the input. I haven't seen "The Rails Way". I've been
through AWDWR and the Pickaxe. I've found the Apress RoR E-Comm book
useful in gaining some production techniques. I need a mid-level how
to book. Let me know if "The Rails Way" is at the top of your list at
this juncture. I have plenty of experience in programming but I'm new
to Rails.
If anyone else has a suggestion, I'd be pleased to hear it.
Regards,
Carson
On Mar 17, 11:09 am, Ed Jones <ed.jo...@gmail.com> wrote:
> Carson, I don't know the answer, but I wonder if you might find it in Chpt 2 of the excellentThe Rails Way. Ch 2 explains all about the dispatcher, and at p 39 it goes to some depth about redirecting.
> Ed
> Carson wrote:I'm building my first custom e-comm application in rails. My catalog listings are a few directories down from the index page, arrived at through various sub-category selection. After adding a product to the cart, I want to redirect to the current url instead of the index. I don't quite know how to do this. I seems to me that I have to capture the current url and pass it to the controller action, then redirect to it. But I could be way off. Any advice? Regards, Carson
On Tue, Mar 18, 2008 at 10:02 AM, Carson <E.CarsonCampb...@gmail.com> wrote:
> Thanks Mark:
> Boy! That was a fast answer.
> Carson
> On Mar 17, 11:04 am, "Mark Van Holstyn" <mvanhols...@gmail.com> wrote: > > redirect_to :back if you want to go back to the last url you were at, not > > sure if that is what you are asking though...
> > Mark
> > On Mon, Mar 17, 2008 at 12:39 PM, Carson <E.CarsonCampb...@gmail.com> wrote:
> > > I'm building my first custom e-comm application in rails. My catalog > > > listings are a few directories down from the index page, arrived at > > > through various sub-category selection. After adding a product to the > > > cart, I want to redirect to the current url instead of the index. I > > > don't quite know how to do this. I seems to me that I have to capture > > > the current url and pass it to the controller action, then redirect to > > > it. But I could be way off.
> > > Any advice?
> > > Regards,
> > > Carson
> > -- > > Mark Van Holstyn, Partner / Software Developer > > mvanhols...@mutuallyhuman.com, (616) 706-6842 > > Mutually Human Software,http://mutuallyhuman.com- Hide quoted text -