title: Check whether the check-box is checked or not using Rails 3
body: <p>I have a check-box inside a form.I need if user will checked this check-box suddenly the action will execute and it will check the check-box status whether it is checked or not using Rails 3.My form is given below.</p>
  
  <blockquote>
    <p>paym.html.erb:</p>
  </blockquote>
  
  <pre><code>&lt;%= form_for :add_payment,:url =&gt; {:action =&gt; 'add_payment' },remote: true do |f| %&gt;
  &lt;table class="table table-bordered"&gt;
          &lt;colgroup&gt;
              &lt;col class="col-md-1 col-sm-1"&gt;
              &lt;col class="col-md-1 col-sm-1"&gt;
              &lt;col class="col-md-3 col-sm-3"&gt;
              &lt;col class="col-md-3 col-sm-3"&gt;
              &lt;col class="col-md-4 col-sm-4"&gt;
          &lt;/colgroup&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th class="text-center"&gt;&lt;input type="checkbox"&gt;&lt;/th&gt;
                  &lt;th class="text-center"&gt;Sl. No&lt;/th&gt;
                  &lt;th class="text-center"&gt;Date&lt;/th&gt;
                  &lt;th class="text-center"&gt;Receipt No.&lt;/th&gt;
                  &lt;th class="text-center"&gt;Amount&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
              &lt;% @result.each do |r| %&gt;
              &lt;tr&gt;
                  &lt;th class="text-center"&gt;&lt;%= check_box_tag :check_value,nil,:id =&gt; "checkbox1-1"  %&gt;&lt;/th&gt;
                  &lt;td class="text-center"&gt;&lt;%= r.id %&gt;&lt;/td&gt;
                  &lt;td class="text-center"&gt;&lt;%= r.c_date %&gt;&lt;/td&gt;
                  &lt;td class="text-center"&gt;&lt;%= r.Receipt_No %&gt;&lt;/td&gt;
                  &lt;td class="text-center"&gt;&lt;i class="fa fa-rupee"&gt;&lt;/i&gt;&lt;%= r.v_amount %&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;% end %&gt;
       &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <blockquote>
    <p>paym_controller.rb:</p>
  </blockquote>
  
  <pre><code>class PaymentsController &lt; ApplicationController
  def add_payment
  
      end
  end
  </code></pre>
  
  <p>Here i have a table with some value .I also need when user will checked that box <code>1-It will check whether check box is checked or not,2-If checked then it will get all table value corresponding to that check-box</code>.Please help me.</p>