@ -154,7 +154,13 @@ end
# Auction stuff
get "/auctions" do
serve :"auction/index"
title = params[:title]
#categories = (params[:categories].split ",").map {|id| id.to_i}
#price_rng = (params[:price_rng].split "-").map {|p| p.to_i}
isopen = params[:isopen]
auctions = Auction.search title#, categories, price_rng, isopen
serve :"auction/index", {auctions: auctions}
end
get "/auctions/new" do
@ -236,7 +236,7 @@ class Auction < EntityModel
def self.compose_query_filters(title=nil, categories=nil, price_rng=nil, isopen=nil)
querystr = "SELECT * FROM Auction "
querystr += "WHERE " if title or categories or price_rng or time_left
querystr += "WHERE " if title or categories or price_rng or isopen
filters = []
filters << "LIKE '%#{title}%'" if title
@ -15,3 +15,8 @@
input type="submit" value="Search"
article
h2 Results
ul
- auctions.each do |auction|
li
| #{auction["title"]}