Hello. thanks in advance for your time, i hope this is a simple question.. (I'm very new (< 1 week) to ruby and rails).

I'd like to create a list view displaying all 'user' records. At the same time, each list item should be a small form with auto-filled fields and a submit button labelled 'update'.

I'm a little stuck on how to implement multiple 'edit' type forms in one view page (all the tutes ive seen deal with only a single form).

My code looks like the listing below. I didn't expect it to work, but incase it's useful to know, at the moment it results in the appropriate number of forms being created, but the fields of the forms aren't being populated:

in the controller:
PHP Code:
def list_users
      
@existingusersUser.find_all
  end
  
  def update_user
   
@existinguser=User.find(@params[:id])
   if @
existinguser.update_attributes(params[:existinguser])
       
flash[:notice] = 'Account was successfully updated.'
    
redirect_to (:action => 'list_users')
    else
       
flash[:error] = 'Account couldnt be updated.'
       
render :action => 'list_users'
    
end
  end 
in the list_users.rhtml view:
PHP Code:
<%= render(:partial => "user_edit", :collection => @existingusers) %> 
in the _user_edit.rhtml partial
PHP Code:
<%= form_tag :action=> "update_user", :id => user_edit %>

<
label for="user_username">Username:</label><br/>
<%= 
text_field "user""username", :size => 15 %><br/>
  
<
label for="user_password">Password:</label><br/>
<%= 
password_field "user""password", :size => 15 %><br/>
  
<
label for="user_password_confirmation">Confirm password:</label><br/>
<%= 
password_field "user""password_confirmation", :size => 15 %><br/>
  
<
input type="submit" value="Update user" class="primary" />
<%= 
end_form_tag %>