I18n和雪人的param冲突

时间:2013-06-27 11:16:53

标签: ruby-on-rails-3 url rails-i18n

我正在使用rails国际化,因此我的网址如下所示:

http://localhost:3000/dashboard/index?locale=es

我有一个带get方法的表单,它将雪人参数附加到URL:

http://localhost:3000/dashboard/index?locale=es?utf8=%E2%9C%93&dateregistration=2013-06-20

代替:

    http://localhost:3000/dashboard/index?locale=es&utf8=%E2%9C%93&dateregistration=2013-06-20

问题是如果我重新加载位置(F5)......我发现param语言环境是:

p locale
:"es?utf8=V"

代替:

p locale
:es

所以I18n无效。

有任何想法或建议吗?

感谢。

1 个答案:

答案 0 :(得分:0)

?应仅位于URL中的第一个参数之前。其他所有都应该以{{1​​}}开头。

因此您的表单需要生成URL

&

...请注意http://localhost:3000/dashboard/index?locale=es&utf8=%E2%9C%93&dateregistration=2013-06-20 之前的&