end
def create
- # A new rentable must be created whenever we create a new game
- @rentable = Rentable.new
- @rentable.save
@game = Game.new(params[:game])
- @game.rentable_id = @rentable.id
if @game.save
flash[:notice] = 'Game was successfully created.'
redirect_to :action => 'list'
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