Using Ajax in Rails 2.1

I hate to ask, but can some one help me out on this one? I've made a
small app in which users login, and once logged in they type their
names in to a textbox, submit it, and once submitted it says "Hello
and Welcome <their name>". For authentication I used
acts_as_authenticated. The app works except for the adding names
feature. Can you help me? This is the code that i put, but I can't get
the submitted name to appear next to "Hello and Welcome" so all
instead of seeing "Hello and Welcome <name>", it shows Hello and
Welcome.
Here's the code for my view

  <html>
  <head>
    <title> My little login APP!</title>
    <%= javascript_include_tag :defaults %>
  </head>
  <body>
    <h1>My little login APP!</h1>

    <%= error_messages_for :user %>
    <% form_for :name do |f| %>

    <%= form_remote_tag (:update => "name",
                        :url => { :action => :add_item},
                        :position => "top") %>

    <p>Please submit your name:</p>
    <%= text_field_tag :newitem %>
    <%= submit_tag "Submit" %>

  <ul id="name">
      <p><h3>Hello and Welcome!</p></h3>
     </ul>

    <hr>
    </hr>

    <p><b><i><%= current_user.login %></p></b></i>
    <p><a href="account/login"><%= submit_tag 'Logout' %></a></p>
    <% end %>
  </body>
</html>

That's because you forgot to surround fields that need to be submitted
in ajax call in do...end block. Also if i remember correctly html
doesn't allow nesting forms, so your code should be rewritten like
this:
<% form_remote_tag (:update => "name",
                        :url => { :action => :add_item},
                        :position => "top") do %>

    <p>Please submit your name:</p>
    <%= text_field_tag :newitem %>
    <%= submit_tag "Submit" %>
<% end %>

<% form_for :name do |f| %>
  <ul id="name">
      <p><h3>Hello and Welcome!</p></h3>
     </ul>

    <hr>
    </hr>

    <p><b><i><%= current_user.login %></p></b></i>
    <p><a href="account/login"><%= submit_tag 'Logout' %></a></p>
<% end %>

Notice do...end near remote form tag. Also your html is not really
proper. You should first close tags that were opened last. So instead
of <p><h3>Hello and Welcome!</p></h3> you should write <p><h3>Hello
and Welcome!</h3></p>. Also there's no need to use h3 and p tags
together since h3 is a paragraph header. And ul should be used
together with li. I believe in your case div would be enough.

The interesting bit is probably what's in your controller.
Fred