Ignore blank queries instead of adding a bum empty one, and change redirect not be hard-coded

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@528295 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Erik Hatcher 2007-04-13 00:36:31 +00:00
parent d116528602
commit 021f4eef00
1 changed files with 6 additions and 3 deletions

View File

@ -51,8 +51,11 @@ module Flare
def add_query
@flare.queries << {:query => params[:search][:query]}
@flare.page = 1
query = params[:search][:query].strip
if query.size > 0
@flare.queries << {:query => query}
@flare.page = 1
end
redirect_to :action => 'index'
end
@ -61,7 +64,7 @@ module Flare
@flare.queries[params[:index].to_i][:query] = params[:value]
@flare.page = 1 # TODO: let the context adjust this automatically when its state changes
render :update do |page|
page.redirect_to '/browse'
page.redirect_to :action => 'index'
end
end