I'm using a meta_search on my rails 3 app. By default (before pressing a search button) meta_search returns all elements of searching model. and I want to set 0 result before user pressing a search button or if search params is blank.
I am using meta_search as follows:
def index
@search = Article.search(params[:search])
if params[:search].blank?
@places = nil
else
@places = @search.all
end
end
What is the best way to set a 0 result if search params is blank ?
Thanks