Hello Folks, I’m a Rails newbie and I have a form to input new users.
Below the form I have the list of the users and I would like when a new
user is inputted, the list is updated. I thought to use form_remote_for.
This is my code:
<% form_remote_for :user, :url => {:action => ‘add_user’}, :update =>
‘userList’ do |form| %>
<%= form.text_field :name %>
<%= form.text_field :password %>
<%= submit_tag “add”%>
<% end %>
name | password |
---|
where @user_list is defined within the controller
class UserController < ApplicationController
def add_user
@user_list = User.find_for_display
…
end
end
The problem is that when I try to add a new user the rendered page is
wrong, I mean several images are in the wrong position and the list is
not updated.
Where is the mistake ??? THANK YOU