title: Count link click
body: <p>I'm trying to get a method in place that registers link clicks. After reading about this subject and trying a lot I don't get it to function. My best try, which does not work, is  <code>&lt;%= link_to person.name, person_url, :method =&gt; :count_new %&gt;</code>. The person_url is the url I want people who click the link should go to. The count_new method looks like this:</p>
  
  <pre><code>stat = Stat.find_by_country(params[:country])
  stat = stat.download+=1
  stat.save
  </code></pre>
  
  <p>The params[:country] is in the url.
  I know update_attributes works better but I'll get to that later.</p>
  
  <p>I looked into counting the views on the person_url page but I really want to register clicks from different links in stead of registering views on the actual page user go to.</p>
  
  <p>I'm on rails 3.</p>
  
  <p>Any help is appreciated.</p>
  
  <p>Rutger</p>