select ... :index => nil is not working

Dear all

I have been trying to get this piece of code working http://pastie.org/236978

<div class="category">
        <% fields_for "daleel[categories_attributes][]", category do |
category_form| %>
          <p>
            category:
            <%= category_form.select "category_id",
@categories, :prompt => "category", :index => nil %>

            <% if category.new_record? %>
                <%= link_to_function "remove", "$
(this).up('.task').remove()" %>
            <% else %>
                <%= link_to_function "remove",
"category_for_destroy(this)" %>
                <%= category_form.hidden_field :id, :index => nil %>
                <%= category_form.hidden_field :should_destroy, :index
=> nil, :class => 'should_destroy' %>
             <% end %>
          </p>
        <% end %>
</div>

The problem is this

the select statement should hide the id however, it does not work for
select and it works for the hidden field. I was trying hard to get it
working in the past two days. I tried to put :index => nil in
the :options and :html_options and the same problem did not get
solved

this concept was gotten from http://railscasts.com/episodes/75

Thanks in advance

any idea

Did you see the note at the bottom of that episode:

"The code for this screencast isn’t the greatest, it requires
the :index option for the fields and does not work well in Rails 2.
Instead I recommend going with the approach I show in Advanced Rails
Recipes"

Fred