title: Grails forms & URL mapping
body: <p>I am writing a Grails app where I would like to setup a form that allows a user to type in an image ID number and this value will be passed to a controller / action that retrieves the image from S3 for the given image ID.</p>
  
  <p>The desired url would be of the format example.com/results/1234.  I have setup the following URL mappings:</p>
  
  <pre><code>class UrlMappings {
  
      static mappings = {
          "/$controller/$action?/$id?"{
              constraints {
                  // apply constraints here
              }
          }
  
          "/results/$id?" {
              controller = "s3Image"
              action = "getS3Image"
          }
  
          "/"(view:"/index")
          "500"(view:'/error')
      }
  }
  </code></pre>
  
  <p>The following is how I have setup a form:</p>
  
  <pre><code>&lt;g:form  controller="results" method="get"&gt;
      &lt;input type="text" name="id" class="input-xxlarge" placeholder="http://www.example.com"&gt;
        &lt;button class="btn btn-inverse"&gt;Submit&lt;/button&gt;
  &lt;/g:form&gt; 
  </code></pre>
  
  <p>However this seems to submit the form to example.com/results?id=12345.</p>
  
  <p>How would I alter my form or mappings such that I can produce the desired url after form submission?</p>
  
  <p>Thanks!</p>