Topic: link_to_function not working?

In my invoices_application_helper:

  def add_item_link(name)
    link_to_function name do |page|
      page.insert_html :bottom, :items, :partial => 'item', :object => Item.new
    end
  end

In my view:

    <p>
        <%= add_item_link "Add Item" %>
    </p>

The _item.html.erb:

<div class="item">
<% new_or_existing = item.new_record? ? 'new' : 'existing' %> <% prefix = "invoice[#{new_or_existing}_item_attributes][]" %>
<% fields_for prefix, item do |item_form| -%>
<p>
Task: <%= item_form.text_field :serial %>
<%= link_to_function "remove", "$(this).up('.item').remove()" %>
</p>
<% end -%>
</div>

This is a recipe from Ryan Bates from the Advanced Rails Reciped book.
I did everything but my function doesnt seems to work.
I am using Rails 3 btw.

Any help how to get this work?