title: Rails 4 use link_to or button_to to run method?
body: <p>I am implementing a simple voting system and by clicking on a button a +1 is added. For example, if a question has 5 votes, it will just increase. I have written the method already, but I am not sure how to execute it by clicking on a link_to. Do I need to reconfigure my routes?</p>
  
  <p><strong>questions_controller.rb</strong></p>
  
  <pre><code>  def self.ping
      @question = Question.find(params[:id])
      @question.increment!(:amplify)
  
      render_to do |format|
        if @question.save
          format.html { redirect_to @question }
        end
      end
    end
  </code></pre>
  
  <p><strong>routes.rb</strong></p>
  
  <pre><code>resources :questions
  post '/ping' =&gt; 'questions#ping', as: 'ping'
  </code></pre>