title: Click a rails link_to with jQuery
body: <p>I'm trying to click a rails ajax link using jquery by clicking on a google map marker but can't figure out how to do it. Here's the link :</p>
  
  <p><code>sidelistings div</code></p>
  
  <pre><code>&lt;% @properties.each_with_index do |property,index| %&gt;
            &lt;div class="sidelisting" id="&lt;%= index %&gt;"&gt;
              &lt;div&gt;&lt;%= link_to image_tag("http://432.mlsimages.movoto.com/0#{property.mls.last(2)}/tn/#{property.mls}_0.jpg"), {:action =&gt; 'show', :id =&gt; property.id}, :remote =&gt; true %&gt;  &lt;/div&gt;
  </code></pre>
  
  <p>I have a google map with 20 markers on it which match the 20 properties in the above <code>sidelistings</code> div. I want to be able to click on the map marker and that will click the above link for it's corresponding property. I have made the <code>id</code>s of the 20 sidelistings match the indexes of the array of map markers. Here's my attempt at the jquery in the google maps code:</p>
  
  <pre><code>google.maps.event.addListener(markerArray[i], 'click', function(){
           var element = this.id;
           var sidelisting = document.getElementById(element);
           $('sidelisting:a').click();
       });
  </code></pre>
  
  <p>The above code doesn't throw any errors in the console but clicking on the map marker does nothing, what am I doing wrong?</p>