Hi,

I keep double render error after updating rails. Heres my code, any
suggestions?

 def show
        if_user_formulated_request_properly do
        @input_messages = InputMessage.search_by(params[:query].strip)
unless params[:query].blank?
        end
        respond_to do |format|
          format.html #default rendering
        end
        end
  end


  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 => "index") and return

    end
    if params[:query].blank?
      flash[:error] = "Search criteria can not be blank"
redirect_to(:action => "index") and  return

    end
    if !(params[:query] =~ /-/)
      flash[:error] = "( Format of search criteria is wrong.<br />
Should be [IXLSpecClass value][year]-[Message ID] for example GP07-8)"
redirect_to(:action => "index") and  return

    end

    if !(QueryParser.expression.match(params[:query]))
      flash[:error] = %( Format of search criteria is wrong.<br /
>Should be [IXLSpecClass value][year]-[Message ID] for example GP07-8)
redirect_to(:action => "index") and return
  end
 yield

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to