title: Rails/AJAX partial rendering
body: <p>I made an application that has a <code>project</code> model. The model has some information stored in it, and a user can add comments to the <code>project</code> (using the <code>comment</code> model). In the show view of a project I want the user to be able to switch between an "info" partial (containing the project information, and a "comment" partial (containing the comments wrote on the project). I want to do this using AJAX. So I will have two buttons: Information &amp; Comments. </p>
  
  <p>Now I know how to render a partial based on a "remote link", but I'll also have to find out which link was clicked. So far I can render one partial when one link is clicked like so:</p>
  
  <pre><code>// In show.html.haml
  
  = link_to("Information", :project, :id =&gt; "link_one", :remote =&gt; true)
  = link_to("Comments", :project, :id =&gt; "link_two", :remote =&gt; true)
  
  #partial_window
  
  
  // In show.js.haml
  $("#partial_window").html("#{j(render("comments"))}")
  </code></pre>
  
  <p>Now this renders the <code>_comment.html.haml</code> partial when I click on one of the links. What I need to know is how to check <em>which</em> link was clicked, and then render the appropriate partial: <code>_info.html.haml</code> or <code>_comments.html.haml</code>.</p>
  
  <p>Thanks in advance for your help!</p>