Forum: Ruby on Rails Access To Referring Controller

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Justin P. (Guest)
on 2006-04-27 03:08
I have a controller, that when it is finished doing it's thing, should
always redirect back to the controller that called it.  Is there any
built-in way to access who the referring controller was?

For example

A controller calls ControllerB

ControllerB does it's thing and should be able to redirect back to the
previous controller, whether it is ControllerA or ControllerC, without
know who it was.

Is there any default way to do this?  Seems like variable with the
referring controller and action would be pretty handy.
Ben R. (Guest)
on 2006-04-27 03:13
(Received via mailing list)
Why not move the code into a library so it can be called from any
action without having to go to another controller?

~ Ben

On 4/26/06, Justin P. <removed_email_address@domain.invalid> wrote:
> know who it was.

Ben R.
This topic is locked and can not be replied to.