When a user tries to create a record with a name that already exists, I want to show an error message like:
name \"some name\" has already been taken
It looks like you can pass a Proc to the message. When you do this, you get two parameters:
:activerecord.errors.models.user.attributes.name.takenSo if you allow for two parameters on a proc, you can use the attributes[:value] item to get the name that was used:
validates_uniqueness_of :name,
:message => Proc.new { |error, attributes|
"#{attributes[:value]} has already been taken."
}