Forum: Ruby on Rails How to show error messages in pop up or confirm screen ?

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.
056662548e038671a0b2eafd139b7d7d?d=identicon&s=25 Adriano Lul (adrianod)
on 2009-02-11 18:58
I would like to show messages when the validation fails (must be number,
cant be blank, etc)  but not in the main page I would like to open a pop
up or better yet put it in a confirm screen where user would read and
thereafter click ok.

Anyone could help me ?
Thanks in advance

ps: sorry for bad english
C64e63b70be7dfed8b0742540b8b27e5?d=identicon&s=25 Mark Reginald James (Guest)
on 2009-02-13 10:30
(Received via mailing list)
Adriano Lul wrote:
> I would like to show messages when the validation fails (must be number,
> cant be blank, etc)  but not in the main page I would like to open a pop
> up or better yet put it in a confirm screen where user would read and
> thereafter click ok.

render :update do |page|
   if obj.save
     ...
   else
     page.alert obj.errors.full_messages.join("\n")
   end
end

--
Rails Wheels - Find Plugins, List & Sell Plugins -
http://railswheels.com
056662548e038671a0b2eafd139b7d7d?d=identicon&s=25 Adriano Lul (adrianod)
on 2009-02-13 11:47
even for validation models ?
THanks!!!
This topic is locked and can not be replied to.