<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;p&gt;Add these to your files&lt;/p&gt;
&lt;p&gt;account_controller.rb&lt;/p&gt;
&lt;pre&gt;
#
#Edit User
#
    #
    #allow a user to edit their details
    def edit
        @user = User.find(self.current_user.id)
    end

    #
    #update the user table
    def update
        @user = User.find(self.current_user.id)
        if @user.update_attributes(params[:user])
            flash[:notice] = 'User was successfully updated.'
            redirect_to :action =&amp;gt; 'index'
        else
            render :action =&amp;gt; 'edit'
        end
    end
&lt;/pre&gt;
&lt;p&gt;create the following views&lt;/p&gt;
&lt;p&gt;_userForm.rhtml&lt;/p&gt;
&lt;pre&gt;
&amp;lt;%= error_messages_for 'user' %&amp;gt;
&amp;lt;!--[form:user]--&amp;gt;
&amp;lt;!-- all custom fields here --&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;label for=&quot;user_email&quot;&amp;gt;Email Address&amp;lt;/label&amp;gt;&amp;lt;br/&amp;gt;
&amp;lt;%= text_field 'user', 'email'  %&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;!--[eoform:user]--&amp;gt;
&lt;/pre&gt;
&lt;p&gt;edit.rhtml&lt;/p&gt;
&lt;pre&gt;
&amp;lt;p&amp;gt;Edit your details&amp;lt;/p&amp;gt;
&amp;lt;%= start_form_tag :action =&amp;gt; 'update' %&amp;gt;
    &amp;lt;%= render :partial =&amp;gt; 'userForm' %&amp;gt;
    &amp;lt;%= submit_tag 'Edit' %&amp;gt;
&amp;lt;%= end_form_tag %&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Is this a really bad way to do this? What is to stop someone from building a request that will reset the users password or change their login?&lt;br /&gt;
:: It should be safe if the model is protected with attr_protected or attr_accessible&lt;br /&gt;
And if they update their email, you should go through the activate process again if you&#8217;ve enabled this feature.&lt;/p&gt;
&lt;p&gt;I was a bit confused about using attr_protected. After looking it up, it seems if you want to make sure they can&#8217;t change their login or other info you add attr_protected to the user model. This can be done with the line:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Protects from url auto assignment&lt;br /&gt;
attr_protected :login&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Read more about attr_protected, here:&lt;br /&gt;
http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M001005&lt;/p&gt;
&lt;p&gt;but adding that causes a ton of tests to fail, it seems to mess up the default signup function. I worked around many of these issues only to find new problems created by adding the attr_protected on login. Such as the default tests all failing.&lt;/p&gt;
&lt;p&gt;Anyone else have better suggestions&lt;/p&gt;
&lt;p&gt;The defaults test all assume that none of the attributes are protected. You&#8217;ll need to edit them to make sure that :login isn&#8217;t being auto-assigned. When you need to assign :login from a form, don&#8217;t use User#create, do it like this:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
@user = User.new(params[:user])&lt;br /&gt;
@user.login = params[:user][:login]&lt;br /&gt;
@user.save&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
You&#8217;ll want to restrict this kind of action to, say, Admins who have the right to change logins.&lt;/p&gt;</body>
  <created-at type="datetime">2008-10-24T03:11:11-07:00</created-at>
  <id type="integer">71671</id>
  <permalink>allow-users-to-edit-details</permalink>
  <repository-id type="integer">67186</repository-id>
  <title>Allow users to edit details</title>
  <updated-at type="datetime">2009-03-01T13:16:42-08:00</updated-at>
  <user-id type="integer">59179</user-id>
</wiki>
