Letting users edit their profiles

I’m trying to let users change attributes of their User objects…
their pw, e-mail, etc. For some reason it’s not updating. Pressing
the “update” button results in a screenful of javascript (from the rjs
template?). Don’t want to paste all of it, but here’s a sample:

try {
Element.update(“content”, “<form action=”/login/update_user/1"
method=“post”>\n

\n\t\n\t\t\n\t\t\n\t\n\t\n\t\t\n\t\t\n\t\n\t\n\t\t\n\t\t\n\t\n\t\n\t\t\n\t\t\n\t\n\t\n\t\t\n\t\t\n\t\n
username<input
id=“user_name” name=“user[name]” size=“30” type=“text”
value=“josh”
/>
password<div
class=“fieldWithErrors”><input id=“user_password”
name=“user[password]” size=“30” type=“password” value=""
/>
e-mail<input
id=“user_email” name=“user[email]” size=“30” type=“text”
value=""
/>
roommate<input
id=“user_roommate” name=“user[roommate]” size=“30” type=“text”
value=“chris” />
<input
type=“submit” value=“Update Profile”
/>
\n\n

1\n");
Element.update(“nav”, “<dt id=“logo”>divvy\n\t \n\t\t<dd
id=“t-logout”>\n\t\t<a href=”/login/logout">Log
out\n\t\n\t\t\n\t<dd id=“t-add_user”>\n\t\t<a href="#"
onclick=“new Ajax.Request(’/login/add_user’, {asynchronous:true,
evalScripts:true}); return false;”>Add user\n\t\n\t<dd
id=“t-list_users”>\n\t\t<a href="#" onclick=“new
Ajax.Request(’/login/list_users’, {asynchronous:true,
evalScripts:true}); return false;”>List users\n\t\n\t\n\t<dd
id=“selected”>\n\t\t<a href="#" onclick=“new
Ajax.Request(’/login/edit_user’, {asynchronous:true,
evalScripts:true}); return false;”>Profile\n\t\n\t<dd
id=“t-curmo”>\n\t\t<a href="#" onclick=“new
Ajax.Request(’/admin/this_month’, {asynchronous:true,
evalScripts:true}); return false;”>This Month\n\t\n\t");
} catch (e) { alert(‘RJS error:\n\n’ + e.toString());
alert('Element.update(\ …

Here’s my code:

from Login controller-

def edit_user
@user = User.find(:first, :conditions => [“name = ?”,
“#{session[:user_name]}”])
end

def update_user
@user = User.find(params[:id])
if @user.update_attributes(params[:@user])
redirect_to_index(“Profile updated.”)
else
render :action => ‘edit_user’
end
end

from edit_user template:
<%= form_tag :action => ‘update_user’, :id => @user %>

Any help would be greatly appreciated… (complete noobie at this
stuff!)