myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [1924] trunk/app/controllers/search_controller.rb


From: noreply
Subject: [myexperiment-hackers] [1924] trunk/app/controllers/search_controller.rb: fixed runtime error when searching without a query string
Date: Wed, 5 Nov 2008 11:23:52 -0500 (EST)

Revision
1924
Author
dgc
Date
2008-11-05 11:23:52 -0500 (Wed, 05 Nov 2008)

Log Message

fixed runtime error when searching without a query string

Modified Paths

Diff

Modified: trunk/app/controllers/search_controller.rb (1923 => 1924)


--- trunk/app/controllers/search_controller.rb	2008-11-05 13:56:16 UTC (rev 1923)
+++ trunk/app/controllers/search_controller.rb	2008-11-05 16:23:52 UTC (rev 1924)
@@ -1,5 +1,12 @@
 class SearchController < ApplicationController
   def show
+
+    if params[:query].nil? or params[:query] == ''
+      flash[:error] = 'Missing search query';
+      redirect_to url_for(:controller => "home")
+      return
+    end
+
     @type = params[:type].to_s.downcase
     
     # Hacks for 'Groups' --> 'Networks' and 'Files' --> 'Blobs' renames

reply via email to

[Prev in Thread] Current Thread [Next in Thread]