I know that with the following code:
before_action :signed_in?, only: [:new]
the action new will be executed if the signed_in
new
signed_in
before_action :new, unless: -> { signed_in? }
alltough i think its better to redirect in the action which was called.
def your_action_called redirect_to :new unless signed_in? [...code ...] end