X-Git-Url: https://irasnyder.com/gitweb/?a=blobdiff_plain;f=app%2Fcontrollers%2Fvideo_controller.rb;h=31575d86e6566b54b0b3953b1c69945417131dde;hb=9b264f25255cc0e7cca3169d99905f590c8be578;hp=a5508aeb8f7e58facda15a98560449316714f7b5;hpb=0acc9549b65f2c3cd1840f39e31f2177a98bc55e;p=cs356-p2-videostore.git diff --git a/app/controllers/video_controller.rb b/app/controllers/video_controller.rb index a5508ae..31575d8 100644 --- a/app/controllers/video_controller.rb +++ b/app/controllers/video_controller.rb @@ -48,4 +48,13 @@ class VideoController < ApplicationController Video.find(params[:id]).destroy redirect_to :action => 'list' end + + def searchbyname + render :action => 'searchbyname' + end + + def searchresults + query = params[:q] + @videos = Video.find(:all, :conditions => ["title like ?", query[0]+"%"]) + end end