title: Multiple Ajax PUTs in Laravel 4 Giving Errors
body: <p>I am updating my Model through a resource controller via jQuery Ajax Put. No problems at all the first time. This works fine:</p>
  
  <pre><code>        $(".addNest").click(function() {
              var nid = msg; //once the LI is added, we grab the return value which is the nest ID
              var name = $('.nestIn').val();
  
              if(name == '') {
                  $("textarea").css("border", "1px solid red");
              }else {
  
                  $.ajax({
                      type: 'PUT', // we update the default value
                      url: 'nests/' + nid, 
  
                      data: {
                          'name': name
                      },
                      success: function(msg) {
                          alert(msg)
                          window.location.replace('nests/' + nid ); //redirect to the show view
                      }
                  });
  
              }
  
          });
  </code></pre>
  
  <p>Later in a separate code block, I try to call the PUT again like this:</p>
  
  <pre><code>$(".nestEdit").click(function() {
  
  $(".nestEdit").hide();
  var name = $('.nestName').data("name");
  var nid = $('.nestName').data("id");
  
  $(".nestName").html("&lt;textarea class='updateNest'&gt;"+ name +"&lt;/textarea&gt; &lt;span&gt;&lt;a href='#' class='btn btn-mini nestUpdate'&gt;&lt;i class='icon-plus'&gt;&lt;/i&gt; Update&lt;/a&gt;&lt;/span&gt;");
  
  $(".nestUpdate").click(function() {
  
      var updatedName = $('.updateNest').val();
  
          $.ajax({
              type: 'PUT', // we update the default value
              url: 'nests/' + nid, 
  
              data: {
                  'name': updatedName
              },
              success: function(msg) {
              alert(msg) // showing the error here
              location.reload( ); //refresh the show view
          }
      });
  });
  </code></pre>
  
  <p>The 'updatedName' values and the 'nid' values are passing fine when I 'alert' them. When I view the return for the first PUT it comes back fine. However, when I view the return for the second PUT I get this:</p>
  
  <pre><code>{"error":{"type":"Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException","message":"","file":"\/Applications\/MAMP\/htdocs\/n4\/bootstrap\/compiled.php","line":8643}}
  </code></pre>
  
  <p>Anyone have some insights here? As you can tell, I am trying to do an inline edit. I have tried to wrap everything into a function but still not helping...</p>