title: Using link_to remote: true to pass parameters to rails
body: <p>So I have a page with several messages, each with a link that changes (refines) the RATING of that message.  When a user clicks on this link, I want an AJAX call that updates the corresponding column value in the database for that message.  When this link is clicked, nothing should happen visibly.  There should be no page refresh or reload.</p>
  
  <p>I've been trying to do this using link_to remote: true, but I can't seem to get it to work.  Documentation online is fairly unclear on this question and with the changes between Rails 2 and 3, some things like :with are no longer supported.</p>
  
  <p>I've copied what I have so far, but I know its far from even coming close to a solution.
  In terms of parameters I need passed into the database, I need the profile_id, the message_id and the new_rating.</p>
  
  <p>Thanks in advance! </p>
  
  <p>show.html.haml</p>
  
  <pre><code>.status-bar
    = link_to "", { action: :refine_result }, remote: true
  </code></pre>
  
  <p>profile_controller.rb</p>
  
  <pre><code>...
  
  def refine_result
    @refinement = ResultRefinement.new
    @refinement.profile_id = params[:profile_id]
    @refinement.message_id = params[:message_id]
  
    @refinement.save
  
    respond_to do |format|
      format.html { render nothing: true }
      format.js { render nothing: true }
    end
  end
  </code></pre>
  
  <p>result_refinement.rb</p>
  
  <pre><code>class ResultRefinement &lt; ActiveRecord::Base
    attr_accessible :profile_id, :message_id, :new_rating, :deleted
  
    belongs_to :profile
  end
  </code></pre>