Forum: Ruby on Rails Checking redirection or the previous action

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.
28a4d1b683ec25e1d0312a2a90f63b6f?d=identicon&s=25 Damaris Fuentes (damaris)
on 2007-04-09 16:05
Hi you all,
I have two actions in my controller in this way:

def list_by_bubble
    Bla bla bla
    redirect_to(:action => 'list_by_filter')
def list_by_filter
  #To display always
  Bla bla bla
  #To display just the rest of the times
  Bla bla bla

That is, the first time, user will go to list_by_bubble, and it
redirects to list_by_filter. In this method, I just one to display the
"display always stuff", not the other. The other stuff will be executed
the rest of the times, but not this first time.
So, my question is, how can I get in "list_by_filter" if the previous
action was "list_by_bubble" or not? Or if I have reached there by a

Thanks :D
58c6efb8466b9f85155fe6aa9fc37fce?d=identicon&s=25 Chris Taggart (christ)
on 2007-04-10 10:44
(Received via mailing list)
Damaris Fuentes wrote:
>   #To display just the rest of the times
> Thanks :D
Not sure I understand what you're trying to do. It sounds like you might
want to have a single list action, with a default set of parameters:

def list
  if #first time visited here

The condition could be set a number of ways -- in the session, with a
cookie, or via a flag in the user's record.

Hope this helps

stuff about old cars
28a4d1b683ec25e1d0312a2a90f63b6f?d=identicon&s=25 Damaris Fuentes (Guest)
on 2007-04-10 12:37
Ok, I will do that.
I thought there was any rails object to ask for that (in the request or

Thanks :D
This topic is locked and can not be replied to.