title: Passing Parameters of AJAX POST to Grails Controller
body: <p>I´m building a social network with Grails and got stucked 
  on giving users inner their editprofile 
  page the chance to paste an youtube-Url into a textfield and by clicking a button a JS regexxes the id out of the URL pasted, an ajax post is fired updating a div with a preview image of the youtube video </p>
  
  <p>the html looks like :</p>
  
  <pre><code>                    &lt;g:textField name="videoinput" class="videoinput reLef" value="" /&gt;
                      &lt;span class="daten_videouploadbtn reLef" &gt;&lt;/span&gt;
  
          &lt;g:render template="/forms/storedVideos" /&gt;
  </code></pre>
  
  <p>the JS looks like : </p>
  
  <pre><code>    $('.daten_videouploadbtn').click(function() {
  
          var string = document.editProfileForm.videoinput.value;
          var neu = string.replace(/http[s]?:\/\/(?:[^\.]+\.)*(?:youtube\.com\/(?:v\/|watch\?(?:.*?\&amp;)?v=|embed\/)|youtu.be\/)([\w\-\_]+)/i, '$1'); 
          var id = RegExp.$1;
  
          jQuery.ajax({
          type:'POST',
          data:RegExp.$1, 
          url:'${createLink(action: 'addVideo')}',
          success:function(data,textStatus){jQuery('#storedvideos').html(data);},
          error:function(XMLHttpRequest,textStatus,errorThrown){}
          });
  });
  </code></pre>
  
  <p>the controller looks like :</p>
  
  <pre><code>def addVideo() {
      def videoitems = !!%%-- HOW TO PARSE YOUTUBE-ID HERE -%%!!
      render(template:"/forms/storedVideos", model: [newVideo:videoitems])
  }
  </code></pre>
  
  <p>and stored videos looks : </p>
  
  <pre><code>    &lt;div id="storedvideos"&gt;&lt;span&gt;&lt;img src="http://img.youtube.com/vi/${newVideo}/default.jpg" width="225px" height="130px"/&gt;&lt;/span&gt;&lt;/div&gt;
  </code></pre>
  
  <p>i just dont get it how to catch the data of the Ajax Post and update the div with the preview image with the id inside,</p>
  
  <p>can someone give a hint ? it is killing me</p>