Forum: Rails France find_or_create et @errors

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Patrick A. (Guest)
on 2007-02-02 20:31
(Received via mailing list)
salut à tous,
jutuilse un validates_uniqueness_of :name.
Dans script/console quand je test find_or_create_by_name('toto') et
que toto existe déjà ca me renvoie bien @errors name has already been
taken. Mais dans mon createname.rhtml ca affiche rien alors que j'ai
bien mis <%= error_messages_for :user %>. Est-ce que vous savez

dans mon controller jai:
@user = find_or_create_by_name('toto')

redirect_to :list
render :action=>'createname'

Merci d'avance

This topic is locked and can not be replied to.