Displaying 1 result from an estimated 1 matches for "failed_".
Did you mean:
failed
2007 Apr 20
0
Rails validations, how to improve them
...models seems fundamentally wrong because they are a view
level thing (for example you may want two different mesages in different
places depending on the reason for the model failing, or you might want
different languages)
The solution? Well it''s simple...we need to know _which validation
failed_ in the error array. So right now the errors look like this
"field" => "message"
In order to be able to specify a custom error message properly we need
to know why the field failed so the appropriate structure would look
something like:
@user.errors = {:validates_uniqueness...