Forum: Ruby on Rails Prompt box

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
C4bfcc81ac9281cb905f38e97e4d4e0b?d=identicon&s=25 Shandy Nantz (snantz)
on 2007-07-18 23:44
I need to add a prompt to a form whenerver someone tries to submit so
bad data. Basically what I have is a form that takes credit card info.
On submit a method gets called that validates the card number. If that
validation fails, I would like a prompt box to show-up and indicate that
an 'Invalid Card Number' was entered. I add the following to my
remote_form helper:

:failure => "alert('ERROR')"

It works, but not quite right. My question is, can I call prompt in a
method in my controller and not as an attribute of the form tag? That to
me would make more sence. I don't know how to do that, however. Anyone
have any ideas or alternatives that might work? Thanks,

This topic is locked and can not be replied to.