Is it possible in Rails to check whether a redirect or render had already been issued?
You can call performed?
in your controller to check if render
or redirect_to
has been called already:
performed? # => falseredirect_to(login_path)performed? # => true
Read more about performed?
in the Rails docs.