摘要: 想练练手,随意的写了个登陆页面,简单的只有几行。却发现,报错了,页面显示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 te 阅读全文
posted @ 2013-11-19 16:09 范孝鹏 阅读(897) 评论(0) 推荐(0) 编辑
摘要: Ror代码class FooController :index # you can disable csrf protection on controller-by-controller basis: skip_before_filter :verify_authenticity_token end 第二种:修改配置文件config\environments\development.rbRor代码# Disable request forgery protection in development environment config.action_contr... 阅读全文
posted @ 2013-11-19 09:58 范孝鹏 阅读(557) 评论(0) 推荐(0) 编辑
摘要: 1,修改routes文件,让所有的action都可以使用get或者post方式访问match "/:controller/:action" => "controller#action" , via: [:get, :post]2,创建一个数据库表user$ rails g scaffold user name:string hashed_password:string salt:string输出内容: invoke active_record create db/migrate/20131102121128_create_users.rb crea 阅读全文
posted @ 2013-11-19 09:54 范孝鹏 阅读(201) 评论(0) 推荐(0) 编辑