Form fields WITHOUT table columns? Can we validate these in

I would like to have a field on a form that does not have an
column in the table.

Yet I would like to perform some validation on the value. I would like
results of the validation to show up
just like the validations that are performed in the model.

This is very similar to the password_confirmation field on a sign up
The password_confirmation is
there on the screen, but probably not in the underlying table. Also, you
have validations associated
with the confirmation field, like “validates_presence_of”.

How is this done?

Thank you.


Answering my own question:

Apparently you can simply add the method to the model…

I did this with attr_accessor and things are working great.


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