# Editing users with restful\_authentication

**URL:** <https://www.ruby-forum.com/t/editing-users-with-restful-authentication/158973>\
**Category:** Rails\
**Created:** [January 29, 2009, 10:45pm UTC](https://www.ruby-forum.com/t/editing-users-with-restful-authentication/158973 "2009-01-29T22:45:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neal\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/74df32/32.png) [@Neal\_L](https://www.ruby-forum.com/u/Neal_L)\
**Post date:** [January 29, 2009, 10:45pm UTC](https://www.ruby-forum.com/t/editing-users-with-restful-authentication/158973/1 "2009-01-29T22:45:58Z")

</div>

Hi all,

I’m using the wonderful restful\_authentication plugin and would like  
to allow users to update their profiles. The problem is that when the  
update method is called, it seems to log out the current user  
(current\_user becomes nil).

Any ideas?

From the Users controller:

def update  
@user = current\_user.client.users.find(params[:id])  
params[:user][:login] = @user.login

```
respond_to do |format|
  if @user.update_attributes(params[:user])
    flash[:notice] = 'User details were successfully updated.'
    format.html { redirect_to client_path(current_user.client) }
    format.xml { head :ok }
  else
    format.html { render :action => "edit" }
    format.xml { render :xml => @user.errors, :status

```

=\> :unprocessable\_entity }  
end  
end  
end

Thanks!

---

<div class="post-metadata">

**Author:** ![Neal\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/74df32/32.png) [@Neal\_L](https://www.ruby-forum.com/u/Neal_L)\
**Post date:** [January 29, 2009, 10:51pm UTC](https://www.ruby-forum.com/t/editing-users-with-restful-authentication/158973/2 "2009-01-29T22:51:18Z")

</div>

n/m this post… problem was unrelated…
