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>.

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

  • 相关阅读:
    AJAX
    Django(cookie和session)
    Django(分页)
    跨站请求伪造和csrf_token使用
    Django(ORM查询联系题)
    Django(ORM查询2)
    Django(ORM查询1)
    Django(ORM常用字段)
    复习
    第二次作业:卷积神经网络 part2
  • 原文地址:https://www.cnblogs.com/fanxiaopeng/p/3431667.html
Copyright © 2011-2022 走看看