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 =>

In my view:

        <%= add_item_link "Add Item" %>

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| -%>
Task: <%= item_form.text_field :serial %>
<%= link_to_function "remove", "$(this).up('.item').remove()" %>
<% end -%>

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?