ruby on rails - How do I check if a controller action is already redirecting? -


OK, as often happens, I have a controller action in my app that is protected from unauthorized access by the first_filter The only thing is that I need to redirect this verb to one more condition:

  class payment  

In my trial, I check to ensure that the operation is properly protected, however, it is also the case that the @ order.is_free statement is true.

Is there any way to check to ensure that I am not already redirecting any other redirects?

I'm assuming the Login_required method redirects if the user does not log in. In which case:

You should return the wrong after redressing your first filter, it will stop the new operation from being called anytime. Later versions of the train do this automatically, if you already render or redirect in the filterer, you may be using the old version.

You should also return to the new handler after the call to redirect, as long as you do not want to always create a new payment object.


Comments