[Long] Problem with Ajax.Updater

app/views/layouts/application.rhtml: <?xml version="1.0"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;

<html xmlns="http://www.w3.org/1999/xhtml&quot;&gt;   <head>     <meta http-equiv="Content-Type" content="application/xhtml+xml" />     <title><%= title %></title>     <%= javascript_include_tag "prototype" %>     <%= stylesheet_link_tag "application.css" %>     <%= stylesheet_link_tag "#{controller.controller_path}.css" %>   </head>   <body xml:lang="en">     <div id="sidepane">       <%= render :partial => 'layouts/sidepane' %>     </div>     <div id="main">       <%= @content_for_layout %>     </div>   </body> </html> app/view/layouts/_sidepane.rhtml: <div id="user"> <% if @user.nil? %>   <h4>Please log in</h4>   <% form_remote_for :login, :update => "sidepane",                      :url => "/login/sidepane" do |f| %>     <div><label for="id">Id:</label>     <%= f.text_field :id %></div>     <div><label for="pass">Password:</label>     <%= f.password_field :pass %><div>     <div><%= submit_tag "Log in" %></div>   <% end %> <% else %>   <h4>User</h4>   <div>First name: <%= @user.first_name %></div>   <div>Last name: <%= @user.last_name %></div>   <div><% form_tag "/login/logout" do %>     <%= submit_tag "Log out" %>   <% end %></div> <% end %> </div> app/controllers/login_controller.rb: class LoginController < ApplicationController   def sidepane     do_login params[:login] if request.post?     render :partial => 'layouts/sidepane'   end

  def logout     session[:user_id] = ""     redirect_to "/"   end

  def do_login login     if request.post?       # I'm add password checking later       session[:user_id] = User.find(login[:id])     end   end

  private :do_login end

If I try to login it deletes div#main (firebug said it as well) and do not update div#sidepane. What's wrong?

Regards