Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 文本\字段\标记占位符忽略rails中空格后的动态文本_Ruby_Ruby On Rails 3_Rails I18n - Fatal编程技术网

Ruby 文本\字段\标记占位符忽略rails中空格后的动态文本

Ruby 文本\字段\标记占位符忽略rails中空格后的动态文本,ruby,ruby-on-rails-3,rails-i18n,Ruby,Ruby On Rails 3,Rails I18n,我正在使用I18n进行国际化。用于使用以下代码在文本\字段\标记im的占位符中以区域设置语言显示占位符内容 <%= text_field_tag('email', "", class: 'form-control', placeholder: t('shared.enter_email')%> 在运行应用程序时,占位符中的内容仅包含Enter及其忽略的name,因为中间有一个空格 我尝试了不同的语法,都产生了相同的结果。有没有办法做到这一点?我可以通过使用这样的插值来解决这个问题

我正在使用I18n进行国际化。用于使用以下代码在文本\字段\标记im的占位符中以区域设置语言显示占位符内容

<%= text_field_tag('email', "", class: 'form-control', placeholder: t('shared.enter_email')%>
在运行应用程序时,占位符中的内容仅包含
Enter
及其忽略的
name
,因为中间有一个空格


我尝试了不同的语法,都产生了相同的结果。有没有办法做到这一点?

我可以通过使用这样的插值来解决这个问题

<%= text_field_tag('email', "", class: 'form-control', placeholder: "#{t('shared.enter_email')}" %>


yml应该是这样的可能
enter\u email:“enter email”
之后你重启了服务器吗?检查输入标签。
占位符
属性包含什么?
<%= text_field_tag('email', "", class: 'form-control', placeholder: "#{t('shared.enter_email')}" %>