How (and where) is implemented validation errors in forms

Hello everybody !

I’m building up an application which export ads to partners;

So I’ve a hbtm association between the 2 models ad and partner; on the
view side, the ad form contains several checkboxes (one per partner).

Well the validation of an ad depends on which partner is linked to it.

So i’d like to associate the validation error to each checkbox tag (to
cirle them in red in the form, when ad validation doesn’t pass).

Do you know when, (in which file?, how?) errors are handled when a form
is build ?

I can’t get information by myself when i need to understand rails
“inside” mechanisms, if one of you can provide me some links which
describe how rails is built, it would be really nice !!

Thanks

Nico

nico itkin wrote:

I can’t get information by myself when i need to understand rails
“inside” mechanisms, if one of you can provide me some links which
describe how rails is built, it would be really nice !!

Thanks

Nico

Nico,

This isn’t an “inside” mechanism. You can write your own custom
validations. Take a look at ActiveRecord::Validations::validate() in
the rails api or do a google search on rails validations to find tons of
tutorials on how to do this…

ilan