Problems with incrementing and multiple submits


Can someone help me with the following questions. I am trying to create
a link_to_remote link named add. Whenever I click add, a new label and
text field will be populated.


(This is already there)
Book 1 text_field add(this is the link)
....when add is clicked..............
.....the following is populated........

Book 2 text_field

My question is how do I increment the number? How do I submit the
various fields, populated and the one that is already there, that are in
the form ? I read some where that it has to do with the id of the field.

This is my controller

def book
  @book =

def save_book
   @book =[:book])
        redirect_to :action => 'some_page'
        render :action=> 'book'

def add_book
@count = 1
   render(:partial => 'additional_book')

This is my view


<td style="width: 374px;"><label>Book <%= @count %></label></td>
<td style="width: 219px;"><%= text_field :book, :book, :id => @count

<div id="content">
<% form_for :book, :url => { :action => :save_book}, :html => { :id =>
"book" } do |n| %>
  <table style="width: 685px; height: 171px;">
    <tbody id="abc">
        <td style="width: 374px;"><label>Book 0</label></td>
        <td style="width: 219px;"><%= n.text_field :book %> <%=
link_to_remote( "add", :update => "abc", :url =>{ :action => :add_book
}, :position => "bottom", :success => "@count ++") %></td>

      <td style="width: 209px;">
        <div id="button">
    <p><%= link_to_function 'Previous', "$('book').submit()" -%></p>
<% end %>