Ror代码 class FooController < ApplicationController protect_from_forgery :except => :index # you can disable csrf protection on controller-by-controller basis: skip_before_filter :verify_authenticity_token end 第二种: 修改配置文件config\environments\developmen…
学习链接:http://cnkerry.iteye.com/blog/350718 解决方法一: class FooController < ApplicationController protect_from_forgery :except => :index # you can disable csrf protection on controller-by-controller basis: skip_before_filter :verify_authenticity_token en…
第一种:  Ror代码 class FooController < ApplicationController       protect_from_forgery :except => :index           # you can disable csrf protection on controller-by-controller basis:       skip_before_filter :verify_authenticity_token   end   class Foo…
js_html_input中autocomplete="off"在chrom中失效的解决办法 分享网上的2种办法: 1-可以在不需要默认填写的input框中设置 autocomplete="new-password"(已实测,有效) 网上咱没有找到对其详细解释,但是发现163邮箱的登录注册是这么用的, 2-在会自动填充内容在form表单的第一个Input前添加一个隐藏的input  type="password"(待验证): <input…
input标签和fmt:formatDate 在jsp中同时使用引号解决办法 使用input标签设置默认值value并格式化fmt时间格式处理 格式化前: <input type="datetime" class="form-control" id="datetimepicker" name="startTime" value="${course.startTime}"> 显示结果如下: 格式化…
误删Django的model中的表解决办法 1.model里面的表格实际的操作都在migrations文件夹中,里面记录了操作过程,当在database和model中删除表格时要注意初始化数据库时会报错,migrations文件中的删除记录执行无结果,因为数据库中已经没有此表格了,所以报错. 2.解决办法:初始化命令不不变,执行代码后加 --fake python manage.py migrate --fake #忽略执行删除操作…
错误截图如下: 这是因为表t_sysuser与表t_sysrole之间存在外键联系导致的 解决办法: 进入到创建的linq to sql类中,右键[属性]-将序列化模式修改为[单向]保存即可…
1 在开发开放聊天室的过程中,遇到使用ajax提交表单插入数据库时会插入两条数据的情况 解决办法,在ajax函数返回后,return false. $("#btn").click(function(){ $.ajax({ do something }); return false; }) 2 去除选中元素的某一个属性使用removeattr 3javascript中与时间相关的函数有setInterval("function",millisec[,"lan…
一.缘由: 之前由于服务器只能密钥登陆,并限制root账户登陆,故用SSH打通了所有服务器,实现了公钥转发scp免输密码等,极大方便了服务器的管理. 最近有个需求,是做数据的异地备份.最简单的用scp脚本喽,但是脚本手动执行是OK的,放入crontab确实不能正常运行. 环境:Ubuntu 14.04 二.解决办法: 脚本执行失败,立马想到打印详细日志Debug,那scp -v 然后看日志,是因为密钥认证失败.我们SSH打通是基于ssh密钥转发的, 联想到之前crontab里拿不到环境变量的问题…
Android的图库会在开机的时候扫描SD卡中的图片,视频等文件,有很多App的私有图片不想在图库中显示,就需要另外处理了. 解决办法:在缓存图片的文件夹中创建 .nomedia 文件. 1. ".nomedia"文件的作用: 当系统在扫描文件夹时,会对含有.nomedia文件的目录视而不见,从而保证目录中的所有媒体文件(图片.音频.视频)隐藏起来不会出现在系统图库和铃声 2. 创建方法 File nomedia = new File( "xxx/xxx/" , &…