- def searchbyname
- render :action => 'searchbyname'
- end
-
- def searchresults
- query = params[:q]
- @videos = Video.find(:all, :conditions => ["title = ?", query])
+ def search
+ if request.post?
+ @query = params[:q]
+ @videos = Video.find(:all, :conditions => ["title like ?", @query[0]+"%"])
+ render :action => 'searchresults'
+ else
+ render :action => 'search'
+ end