zoukankan      html  css  js  c++  java
  • rails的字符编码

    想练练手,随意的写了个登陆页面,简单的只有几行。

    <%= form_tag('login_check') do -%><%= text_field_tag 'user_name', 'Enter your search query here' %><br><%= password_field_tag 'user_password' %><br><%= submit_tag '登录' %><%= button_tag '清空' %><% end -%>

    却发现,报错了,页面显示


    We're sorry, but something went wrong.

    If you are the application owner check the logs for more information.

    在日志中查看到:

    ActionView::Template::Error (Your template was not saved as valid UTF-8. Please either specify UTF-8 as the encoding for your template in your text editor, or mark the template with its encoding by inserting the following as the first line of the template:

    # encoding: <name of correct encoding>.

    了解到是因为字符编码的问题

  • 相关阅读:
    20151019
    20151013
    20150810
    20150626
    20150625
    20150530
    HTML特殊字符大全
    label标签跳出循环
    IIS 负载均衡
    .NET代码执行效率优化
  • 原文地址:https://www.cnblogs.com/fanxiaopeng/p/3431667.html
Copyright © 2011-2022 走看看