I'm using devise 2.0.4 and cannot find where the "Reset password token is invalid" message is defined. I would have thought it was in the locales YAML file but it is not. I've also searched the gem source to no avail, which leads me to think that it must be constructed at run time. In the devise_error_messages! method I see that it must be defined as one of the full_messages for the resource, but being somewhat of a rails newbie I'm not sure where to look for that.
2
votes
Either of these? ./config/locales/devise.en.yml OR ./config/initializers/devise.rb
- salah-1
No. I've done a textmate global search of the entire project (including those files) for that phrase and just for keywords within that phrase and still cannot find where it's defined.
- mcoomey
Ah, yes! I should have done a regex search for reset.password.token. Thanks.
- mcoomey
2 Answers
9
votes
2
votes
The "Reset password token is invalid" message is not defined anywhere.
It is generated dynamically by the full_message method in Rails Active Model Errors
The example from the docs:
company.errors.full_message(:name, "is invalid") # =>
"Name is invalid"