开发者

Customize authlogic error message

I recently switched from restful_authentication to authlogic for authenticating users for my application. I've been exploring the API, and I've found a helper for generalizing error messages and overriding the message with my own, but I was curious as to how you can remove these two lines:

1 error prohibited this user session from being saved

There w开发者_如何学Goere problems with the following fields:

Without messing around with the authlogic gem code, if possible. (Preferably without overriding error_messages_for)

Thanks.


This message are default message of error_messages_for.

If you want change it, you can change the phrase in your en.yml file. with keys :

  errors:
    template:
      header:
        one: "Impossible d'enregistrer ce {{model}} : 1 erreur"
        other: "Impossible d'enregistrer ce {{model}} : {{count}} erreurs"
      body: "Veuillez vérifier les champs suivants : "

You can create a specific FormBuilder too for that. There are a guides about that in http://guides.rubyonrails.org/form_helpers.html chapter 6

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜