Forum: Ruby on Rails editing users with restful_authentication

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bbf55d9960b9905e57621d5da6727b2d?d=identicon&s=25 Neal L (Guest)
on 2009-01-29 22:45
(Received via mailing list)
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!
Bbf55d9960b9905e57621d5da6727b2d?d=identicon&s=25 Neal L (Guest)
on 2009-01-29 22:51
(Received via mailing list)
n/m this post... problem was unrelated...
This topic is locked and can not be replied to.