Let's say I have a search form and I want to validate the length of the keyword. I want the form to highlight the invalid field (like model forms). I've looked everywhere and can't seem to find any useful information on validating non-model-backed forms in Rails 3. I've tried the validatable gem, but this doesn't seem to work with Rails 3:
undefined method `model_name' for Login:Class.
Any ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…