开发者

Why non-English string is recognized in view but not in helper in Rails 3?

开发者 https://www.devze.com 2023-03-09 22:35 出处:网络
Why this: <%= foo(\"Русский\") %> works in 开发者_如何学JAVAview, but this: foo(\"Русский\")

Why this:

<%= foo("Русский") %>

works in 开发者_如何学JAVAview, but this:

foo("Русский")

doesn't work in helper ?

Error: syntax error, unexpected $end, expecting ')'

File's encoding is UTF-8.


Try to add this line (must be first line) in your helper file:

# coding: utf-8
0

精彩评论

暂无评论...
验证码 换一张
取 消