title: How to get the values of table fields to modal box?
body: <p><strong>Table</strong></p>
  
  <pre><code>&lt;tbody id="batch_view" class = "a-checkbox"&gt;
  
  &lt;% @batches.each do |batch| %&gt;
    &lt;tr&gt;
      &lt;td class="&lt;%= batch.id %&gt;"&gt;&lt;%= batch.date.strftime("%Y-%m-%d") if !batch.date.nil? %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%= batch.purchase_center.name.to_s  if !batch.purchase_center.nil? %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%= batch.plant.name.to_s if !batch.plant.nil?%&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%= batch.species.name.to_s if !batch.species.nil? %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%= batch.batch_number %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%= batch.total_quantity %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%= batch.calculated_yeild %&gt;&lt;/td&gt;
  
      &lt;td&gt;&lt;%= link_to '&lt;i class="datato fa fa-calculator"&gt;&lt;/i&gt;'.html_safe, batch, :id =&gt;"#{batch.id}",  "data-toggle" =&gt; "modal", "data-target"=&gt; "#myModal2" %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%= link_to '&lt;i class="fa fa-users"&gt;&lt;/i&gt;'.html_safe, "#", :class =&gt; "addsupplier", :id =&gt; "#{batch.serial_id}", "data-toggle" =&gt; "modal", "data-target"=&gt; "#myModal1" %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%= link_to '&lt;i class="fa fa-trash-o"&gt;&lt;/i&gt;'.html_safe, batch, method: :delete, data: { confirm: 'Are you sure?' } %&gt;&lt;/td&gt;
  
    &lt;/tr&gt;
        &lt;tr class="&lt;%= batch.serial_id %&gt;"&gt;
  
  
        &lt;/tr&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>Modal Box Form</strong></p>
  
  <pre><code>&lt;form class="form-horizontal"&gt;
      &lt;div class="form-group"&gt;
          &lt;label class="col-lg-1 control-label"&gt;Date&lt;/label&gt;
          &lt;div class="col-lg-2"&gt;
              &lt;input type="date" placeholder="Batch Number" class="form-control" required=""&gt;
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
              &lt;label class="col-lg-2 control-label"&gt;Batch Number&lt;/label&gt;
              &lt;div class="col-lg-2"&gt;
                  &lt;input type="text" placeholder="Batch Number" class="form-control" id = "myInput" &gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  &lt;label class="col-lg-2 control-label"&gt;Total Quantity&lt;/label&gt;
                  &lt;div class="col-lg-2"&gt;
                      &lt;input type="text" placeholder="Total Quantity" class="form-control" required=""&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;br&gt;&lt;br&gt;&lt;br&gt;
  
      &lt;div class="form-group"&gt;
          &lt;label class="col-lg-2 control-label" &gt;Sample Yield&lt;/label&gt;
          &lt;div class="col-lg-10"&gt;
              &lt;input type="text" placeholder="Sample Yield" class="form-control"  required=""&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
  
      &lt;div class="form-group"&gt;
          &lt;label class="col-lg-2 control-label"&gt;Headless Quantity&lt;/label&gt;
          &lt;div class="col-lg-10"&gt;
              &lt;input type="text" placeholder="Headless Quantity" class="form-control" required=""&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;br&gt;&lt;br&gt;
  
      &lt;div class="form-group"&gt;
          &lt;div class="col-lg-offset-2 col-lg-5"&gt;
              &lt;button class="btn btn-primary" type="submit"&gt;Submit&lt;/button&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I have one table and one modal form.
  I want to get only some fields from table like Date, name and batch_number in form. </p>
  
  <p>Suppose table contains below data.</p>
  
  <pre><code>In table Date: 08/17/2015
           Name: Dell
   batch_number: 1025-1025
  </code></pre>
  
  <p>Now I need date, Name and batch_number in modal box form automatically displayed in form . Please help me how to processed </p>
  
  <p><strong>Note</strong>: <strong>Lightbox</strong> is also not a problem.</p>