title: GRAILS: findALL() vs FindBy---(params.id)
body: <p>Greeting everyone,</p>
  
  <p>I am trying to pass a parameters from a URL to a findAll() method.</p>
  
  <p><strong>LINE3</strong> I use findAll() to define mouse.</p>
  
  <p><strong>LINE2</strong> def house will bring in the parameter DELAWARE when I go to the page: <a href="http://localhost:8080/TestApp/home/county/DELAWARE" rel="nofollow">http://localhost:8080/TestApp/home/county/DELAWARE</a></p>
  
  <p>House will only show one instance instead of a list.. is there anyway to pass the url instead of ["DELAWARE"]? (please see line 3) thanks :)</p>
  
  <pre><code> def county() {
      def house = Home.findByCounty(params.id)  //sends only user related address to view
      def mouse = Home.findAll("from Home h where h.county= ?", ["DELAWARE"]);
      if (!house) {
      response.sendError(404)
      } else {
  
      [house:house, mouse:mouse ]
      }
  }
  </code></pre>
  
  <p><strong>Working Code +1 @Danilo</strong></p>
  
  <pre><code> def county() {
              def house = Home.findAllByCounty  (params.id)  //sends only county specified thru URL e.g. http://localhost:8080/TestAPP/home/county/DELAWARE
      if (!house) {
          response.sendError(404)
      } else {
              [house:house ]
          }
      }
  </code></pre>