search for: generate_full_message

Displaying 2 results from an estimated 2 matches for "generate_full_message".

2010 Sep 23
7
errors.add, setting the whole message
Hi all. I have an attribute, job_role_id_short, that is being set in a form. This field has a custom validation on it, which does this if it fails: self.errors.add(:job_role_id_short, "cannot be blank") I want to add the error onto the attribute, so that the form builder will wrap the field in a fieldWithErrors div. However, the error it generates says "Job Role Short cannot
2008 Feb 27
8
ActiveRecord validation messages not I18N-friendly and enforces grammar
ActiveRecord validation messages are currently not I18N-friendly. Specifically, I''m referring to the fact that it enforces a certain grammar, namely the beginning of the message must consist of the field name. For example: validates_presence_of :name, :message => "can''t be blank." ...generates the message "Name can''t be blank". This grammar