Forum: Ruby on Rails validates_presence_of and ajax-forms

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B8d11b4c89cfc6e34d6c9fb121c9acac?d=identicon&s=25 Claus Guttesen (Guest)
on 2006-05-19 23:42
(Received via mailing list)
Hi.

I have "validates_presence_of :login, :password, :firstname,
:lastname" in my user-model. I enter the information in
new_user.rhtml:

<%= error_messages_for(:user) %>
<%= form_remote_tag :url => { :action => :register }, :html => { :id
=> 'new_user' } %>

I have a register.rjs with :fade.

Omitting firstname or any other required field doesn't trigger any
error-message. Is it due to my ajax-form?

regards
Claus
D90ef6808433e63203e15a5c2dadb0bb?d=identicon&s=25 Ben Reubenstein (Guest)
on 2006-05-19 23:54
(Received via mailing list)
The portion of your page that is updated when the ajax is called needs
to include your:

<%= error_messages_for(:user) %>

Hope this helps,

Ben


On 5/19/06, Claus Guttesen <kometen@gmail.com> wrote:
> I have a register.rjs with :fade.
>
--
Ben Reubenstein
303-947-0446
http://www.benr75.com
This topic is locked and can not be replied to.