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