Hooking validates

I want to hook the validation routines so that I can flag html labels
and change their color to better indicate which fields need to be
corrected in a form.

Is there a way to do this conveniently and/or conventionally?

On Feb 19, 4:14 pm, Ralph S. [email protected] wrote:

I want to hook the validation routines so that I can flag html labels
and change their color to better indicate which fields need to be
corrected in a form.

Is there a way to do this conveniently and/or conventionally?

Have a look at field_error_proc

Fred

On 19 February 2010 16:14, Ralph S. [email protected] wrote:

I want to hook the validation routines so that I can flag html labels
and change their color to better indicate which fields need to be
corrected in a form.

Is there a way to do this conveniently and/or conventionally?

you can interrogate the model errors to see what fields are invalid,
but it’s easier to use a plugin that someone else has already done the
same thing in. I’ve recently used Formtastic to generate forms and the
resultant helpful, highlighted errors.
http://github.com/justinfrench/formtastic

Michael P. wrote:

On 19 February 2010 16:14, Ralph S. [email protected] wrote:

I want to hook the validation routines so that I can flag html labels
and change their color to better indicate which fields need to be
corrected in a form.

Is there a way to do this conveniently and/or conventionally?

you can interrogate the model errors to see what fields are invalid,
but it’s easier to use a plugin that someone else has already done the
same thing in. I’ve recently used Formtastic to generate forms and the
resultant helpful, highlighted errors.
http://github.com/justinfrench/formtastic

Thanks, Michael.

I have tried formtastic and have found it more of a hassle than a help.

Maybe I’m just not seeing the benefits.


Thanks, Frederick, I’ll look at field_error_proc.

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