title: Render and/or redirect were called multiple times in this action..?
body: <p>I keep getting the DoubleRenderError and I cannot figure out why! Basically, I have an action that calls another action that checks a user inputted query for errors, and if theres an error, its stops and displays the error. But when i type in a query with an error, that when i get the double render! Any suggstions? </p>
  
  <p>Heres the error checker action:</p>
  
  <pre><code>def if_user_formulated_request_properly
      unless request.post?
        flash[:error] = "This page can only be accessed through the search page. (POST request only)"
   redirect_to(:action =&gt; "index") and return
      end
  
      if params[:query].blank?
        flash[:error] = "Search criteria can not be blank"
  redirect_to(:action =&gt; "index") and  return
      end
  
      if !(params[:query] =~ /-/)
        flash[:error] = "( Format of search criteria is wrong.&lt;br /&gt; Should be [IXLSpecClass value][year]-[Message ID] for exam
  ple GP07-8)"
  redirect_to(:action =&gt; "index") and  return
      end
  
      if !(QueryParser.expression.match(params[:query]))
        flash[:error] = %( Format of search criteria is wrong.&lt;br /&gt;Should be [IXLSpecClass value][year]-[Message ID] for examp
  le GP07-8)
  redirect_to(:action =&gt; "index") and return
    end
   yield
  </code></pre>
  
  <p>And just in case you need the action calling this action.. </p>
  
  <pre><code> def show
          if_user_formulated_request_properly do
          @statuses = IXLStatus.find(:all)
          @input_messages = InputMessage.search_by(params[:query].stri
  p) unless params[:query].blank?
          @query = params[:query]
          end
          respond_to do |format|
            format.html #default rendering
          end
          end
    end
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Also forgot to mention, this originally was a rails 2 app and was working, this error started when i upgraded to rails 3 (i believe), so maybe rails 3 does something different with <code>and return</code>?</p>