Simple form_remote_for issue

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 %>

<%= render (:partial => "user", :collection => @user_list)%>
name password

where @user_list is defined within the controller

class UserController < ApplicationController

def add_user
@user_list = User.find_for_display


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

got it

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs