app/controllers/users_controller.rb
def update
    assert_params_must_have :id

    if @user == @current_user
      # don't allow to deactivate the current user
      params[:user].delete(:is_inactive) if params[:user]
    end

    @selected = {'role_id' => ''}
    if (@user.role)
      @selected['role_id']=@user.role.id.to_i
    end

    if @user.update_attributes(params[:user])
      flash[:notice] = 'User has been successfully updated'
      redirect_to :action => 'list'
    else
      render :action => 'edit'
    end 
  end
#
# Updates user's details.
#

Updates user's details.
Updates user ' s details .
def update
    assert_params_must_have :id
    if @user == @current_user
      params[:user].delete(:is_inactive) if params[:user]
    end
    @selected = {'role_id' => ''}
    if (@user.role)
      @selected['role_id']=@user.role.id.to_i
    end
    if @user.update_attributes(params[:user])
      flash[:notice] = 'User has been successfully updated'
      redirect_to :action => 'list'
    else
      render :action => 'edit'
    end 
  end
def update assert_params_must_have :id if @user == @current_user params [ :user ] . delete ( :is_inactive ) if params [ :user ] end @selected = { 'role_id' => '' } if ( @user . role ) @selected [ 'role_id' ] = @user . role . id . to_i end if @user . update_attributes ( params [ :user ] ) flash [ :notice ] = 'User has been successfully updated' redirect_to :action => 'list' else render :action => 'edit' end end
Updates user's details.
Updates user ' s details .
# don't allow to deactivate the current user
