title: JQuery tabs with Rails: replacing tab content
body: <p>I have a tab with a page rendered inside it. Everything is good. Then the user clicks a button. I want the output of doing that to show up inside the tab. Currently it takes the user off the tabs view entirely.</p>
  
  <p>Here's the tab html in the .html.erb file:</p>
  
  <pre><code>&lt;div id="tabs"&gt;
    &lt;ul&gt;
  
      &lt;li&gt;&lt;a href="urls"&gt;Manage URLs&lt;/a&gt;&lt;/li&gt;
      ...other tabs...
    &lt;/ul&gt;
  
    &lt;div id="urls-tab"&gt;
      &lt;p&gt;
      &lt;/p&gt;
    &lt;/div&gt;
    ...other tabs...
  &lt;/div&gt;
  </code></pre>
  
  <p>I have a new button on a form as such:</p>
  
  <pre><code>&lt;%= form_tag('urls/someaction_not_new', :method =&gt; :post, :id = "top-form") do %&gt;
    ...content...
    &lt;input type="button" id="New" value="New" onclick="someJavascript()"&gt;
  
  &lt;% end %&gt;
  </code></pre>
  
  <p>Finally, the javascript:</p>
  
  <pre><code>$("#tabs").tabs();
  
  function someJavascript() {
    document.location = "urls/new"
  }
  </code></pre>
  
  <p>I know that the javascript doesn't work, and I never expected it to. What I need to know is how to build that function such that it loads the 'urls/new' output to the tab rather than redirecting to a new view w/o the tabs.</p>
  
  <p>Any help would be deeply appreciated!</p>