title: Grails pagination not working
body: <p>I've been a week trying to fix this pagination problem, but with no good results,</p>
  
  <p>I have this in my controller</p>
  
  <pre><code>    PatientController{
      def show(Long id) {
      def patientInstance = Patient.get(id)
      if (!patientInstance) {
          flash.message = message(code: 'default.not.found.message', args: [message(code: 'patient.label', default: 'Patient'), id])
          return
      }
  
  
  
      def historyInstance = History.findAllByPatient(patientInstance)
      def total = historyInstance.size()
  
  
      [historyInstance: historyInstance,patientInstance: patientInstance,historyInstanceTotal: total]
  
  
      }
  }
  </code></pre>
  
  <p>And I have this code on the view</p>
  
  <pre><code>    &lt;g:each in="${historyInstance}" var="historyInstances" status="i"&gt;
        ...
      &lt;/g:each&gt;
  
      &lt;div class="pagination"&gt;
          &lt;g:paginate  total="${historyInstanceTotal}"/&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>I used <code>params</code>, the max on the <code>&lt;g:paginate&gt;</code>, I tried everything but with no result it always shows the whole set of History in the view.</p>