title: Redirect_to and render with return
body: <pre><code> def confirm_invite_new_tutor
      redirect_with_msg = false
      @game_school = GameSchool.find(params[:id])
      existing_user_emails = params[:all_emails][:existing_user] || []
      new_users = params[:param_game_school][:game_school_invites_attributes]
  
  if existing_user_emails.present?
        existing_user_emails.each do |existing_user|
          // some code
        end
        redirect_with_msg = true
      end
      if new_users.present? 
        if @game_school.update_attributes(params[:param_game_school])
          redirect_with_msg = true
        else
           render :invite_tutor_form
        end
      end
      if redirect_with_msg 
        redirect_to @game_school, notice: "daw"
       else
        redirect_to @game_school 
      end
    end
  </code></pre>
  
  <p>If I am executing this, I am getting error as </p>
  
  <p>Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect, and at most once per action. Also note that neither redirect nor render terminate execution of the action, so if you want to exit an action after redirecting, you need to do something like "redirect_to(...) and return".</p>
  
  <p>If I use return Its taking me to some other page, and even the flash msg is not shown.
  How to fix this? </p>