title: How do I use remote function with check_box_tag in rails
body: <p>It's a checkbox used for todo list.</p>
  
  <p>Before I used</p>
  
  <pre><code> &lt;%= link_to "Finished!", finish_task_path(feed_item), :method=&gt;:put,:remote=&gt;true%&gt;
  </code></pre>
  
  <p>with a piece of javascript in finish.js</p>
  
  <pre><code> $('#task_&lt;%= @task.id %&gt;.task').fadeOut();
  </code></pre>
  
  <p>Now instead of using </p>
  
  <pre><code>link_to
  </code></pre>
  
  <p>I want to use </p>
  
  <pre><code>check_box_tag
  </code></pre>
  
  <p>So every time user clicks on checkbox, it should make the entry fade out</p>
  
  <p>I tried </p>
  
  <pre><code> &lt;%= check_box_tag 'finish[]',feed_item.id,false,:onchange =&gt; remote_function(:url=&gt;finish_task_path(feed_item),:method=&gt;:put, :before =&gt; "$('#task_#{feed_item.id}').show();", :complete =&gt; "$('#task_#{feed_item.id}').hide(); ") %&gt; 
  </code></pre>
  
  <p>but it doesn't work, and I also don't know how to use </p>
  
  <pre><code>:with =&gt;
  </code></pre>
  
  <p>here.</p>
  
  <p>Thank you in advance.</p>