Reputation: 6105
I would like to know if there is a way to add ruby code in a locale file. For example:
devise:
failure:
unconfirmed: 'You have to confirm your account before continuing. <%= link to "send confirmation instructions?", user_confirmation_path %>'
Thanks for your help!
Upvotes: 2
Views: 646
Reputation: 34774
The way I have solved this in the past is:
devise:
failure:
unconfirmed: 'You have to confirm your account before continuing. {{confirm_link}}.'
confirm_link_text: "send confirmation instructions?"
Then where you need the output:
t('devise.failure.unconfirmed',
:confirm_link => link_to(
t('devise.failure.confirm_link_text'),
user_confirmation_path)
)
Upvotes: 5