01 2014 档案

Rails devise 对xls文件访问401异常的Redirect处理
摘要:1.\config\initializers\devise.rbconfig.navigational_formats = ["*/*", :html,:xls] config.warden do |manager| manager.failure_app = CustomFailure end2.\lib\autoloads\custom_failure.rbclass CustomFailure 'secure') end # You need to override respond to eliminate recall def respond if 阅读全文

posted @ 2014-01-27 13:23 leonworld2011 阅读(276) 评论(0) 推荐(0) 编辑

rails 下载中文文件乱码的解决方法
摘要:下载的文件名如果是中文的,在ie浏览器下文件名会是乱码。解决方法如下 respond_to do |format| filename = CGI::escape(“中文.xls") format.xls {send_data((render_to_string file:"reports/export_exe") ,filename:filename, :disposition => 'attachment') } end 阅读全文

posted @ 2014-01-20 14:44 leonworld2011 阅读(573) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示