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"%></div>
<% end %>
<br/>
<table>
<tr>
<th>name</th>
<th>password</th>
</tr>
<div id="userList"><%= render (:partial =>
"user", :collection =>
@user_list)%></div>
</table>
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
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---