Q:

ROR: Validate Non-model fields in model file

I have some fields in my form that are not part of the model, I know how to validate those fields in the controller, but I was wondering if it is possible to validate this in the model?
If it is possible, how would I validate next?
e.g.
text_field(nil, :non_model_field)

A:

Try this:
put a virtual attribute in the model. 
class MyModel < ActiveRecord::Base

   attr_accessor :non_model_field
   validates :non_model_field, presence: true # or whatever other validations you want

end

