Ruby on Rails以法语闪烁消息 [英] Ruby on Rails flash messages in French

查看:122
本文介绍了Ruby on Rails以法语闪烁消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用法语的rails应用程序,但是当我在Flash消息中包含重音时,它会破坏网站。

Working on a rails app in French, however whenever i include an accent on the flash messages it breaks the site.

例如

format.html {redirect_to @message.annonce, notice:"Votre message a été envoyé"}
format.html {redirect_to @message.annonce, notice:"Votre email n'a pas pu être envoyer à cause d'une erreur."}

我的config / application.rb看起来像这样

my config/application.rb looks like this

 config.i18n.default_locale = :fr
 config.encoding = "utf-8"

如何做这个?

推荐答案

你应该添加编码:UTF-8 作为您的文件的第一行添加口音。

You should add # encoding: UTF-8 as the first line of your file to add accent in it.

如果这不工作,请给我们异常提高了。

If this is not working please give us the exception raised.

这篇关于Ruby on Rails以法语闪烁消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆