title: Rails 3.2.5: Simple issue with search, need to return 'No Results Found' if nothing is found
body: <p>I've looked at a few Railscasts and I know this is pretty simple but can't get it set up.</p>
  
  <p>The actual SEARCH itself is working OK. </p>
  
  <p>If I type in say, 'we' for example, it returns all the results with 'we' in it. Fair enough.</p>
  
  <p>In my listing.rb file I have</p>
  
  <pre><code>  def self.search(search)
      s =  "%#{search}%"
      if search
        find(:all, :conditions =&gt; ["comments LIKE ? or doctor LIKE ? or website LIKE ? or     
        url LIKE ? or date LIKE ?", s, s, s, s, s])
      else
        find(:all)
      end
    end
  </code></pre>
  
  <p>In my listings_controller file I have: </p>
  
  <pre><code>def index
    @listings = Listing.search(params[:search_text])
  end
  </code></pre>
  
  <p>So in the else portion I obviously don't want find(:all)</p>
  
  <p>What would be the coding equivalent of return none or find none? return nil?</p>
  
  <p>If you are in the form itself and it's blank and you hit enter, it should return nothing and it should say "No Results Found" or something like that.</p>
  
  <p>Would the notice itself have to be in the controller, I mean couldn't I do like a render :text => 'No results found' or something? </p>
  
  <p>or something like</p>
  
  <pre><code>elsif
    search.blank? 
    render [:index], flash[:notice] = 'No Results Found'
  end
  </code></pre>
  
  <p>I know this is pretty simple but been out of the coding game for a bit, and relatively new to RoR in general. </p>
  
  <p>Any input is greatly appreciated. Thanks </p>