我想定制devise提供的以下闪存msg
在devise.en.yml文件中:
在devise.en.yml文件中:
devise: failure: unconfirmed: 'You have to confirm your account before continuing.'
与ruby代码,以获得一个链接到new_user_confirmation_path.
换句话说,我想要我的Flash消息显示如下:
'You have to confirm your account before continuing. Didn't receive confirmation instructions?'
哪里没有收到确认说明?是指向new_user_confirmation_path的链接.
我想知道如果我可以这样做,而不需要编辑用户控制器,因为Devise默认情况下不提供它.
感谢您的回答!
解决方法
new_user_confirmation_path是与/ users / confirmation / new相当的静态网址
所以你可以在devise.en.yml文件中做到这一点:
devise: failure: unconfirmed: "You have to confirm your account before continuing. <a href='/users/confirmation/new'>Didn't receive confirmation instructions?</a>"