ActionController::DoubleRenderError -- how to redirect to different paths based on if else condition in rails??

def checkout
     #if the user logged in has billing and shipping address on file,
show edit page else show new page.


     if @useraddress then #user's address exist
       redirect_to edit_user_address_path( and return
     else #user's address doesn't exist
       redirect_to new_user_address_path and return


The above code is giving me DoubleRenderError. I want to go to
edit_user_address_path if the if condition is true else I want to go
to new_user_address_path to create one.
Can any one help me? I don't see any good documentation on this.


what login_required method do here? I mean is this also redirecting to some other url ??