Validation non-model fields

I’d like to add a new field on my partial template witch is not
present in my database schema.
I’d like to validate it like others text_fields from my database. How
can I do it??

Daniello wrote:

I’d like to add a new field on my partial template witch is not
present in my database schema.
I’d like to validate it like others text_fields from my database. How
can I do it??

You may want to add a virtual attribute in the model.

Model example:
attr_accessor :not_on_db

validates_presence_of :not_on_db,
validates_length_of :not_on_db, :within => 1…5

Thanks a lot from Poland!