Add searching to the games controller
[cs356-p2-videostore.git] / app / controllers / game_controller.rb
index 175a63f..39f5485 100644 (file)
@@ -48,4 +48,13 @@ class GameController < ApplicationController
     Game.find(params[:id]).destroy
     redirect_to :action => 'list'
   end
+
+  def searchbyname
+    render :action => 'searchbyname'
+  end
+
+  def searchresults
+    query = params[:q]
+    @games = Game.find(:all, :conditions => ["title = ?", query])
+  end
 end