上一页 1 2 3 4 5 6 ··· 8 下一页
摘要: 简单总结: 1、JS是一门前端语言。 2、Ajax是一门技术,它提供了异步更新的机制,使用客户端与服务器间交换数据而非整个页面文档,实现页面的局部更新。 3、jQuery是一个框架,它对JS进行了封装,使其更方便使用。jQuery使得JS与Ajax的使用更方便 关系比喻: 若把js比作木头,那么jq 阅读全文
posted @ 2023-12-19 16:35 鞋带松了 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 1. 让sym 和string 都能访问hash with_indifferent_access 2. ruby 中的 urlencode 和 urldecode ##1、使用 URI::encode require 'open-uri' puts URI::encode 'C#' #输出C%23 阅读全文
posted @ 2023-06-09 13:33 鞋带松了 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 在做文件上传时除了传入文件外,还有附件参数,并且要求不刷新页面,之前是表单提交的方式,现在修改成ajax上传的方式,由于没有选择用插件,所以用form+iframe的方式,并且这种方式对IE8以上及主流浏览器都支持。 1、首先写一个iframe <iframe name="myiframe" sty 阅读全文
posted @ 2023-05-23 14:08 鞋带松了 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 1. 从文件内容查找匹配指定字符串的行 ###grep 字符串 filename eg: grep 2019 on.log 2. 从文件内容查找与正则表达式匹配的行 grep -e 正则表达式 filename 3. 查找时不区分大小写 grep -i 字符串 filename 4. 查找匹配的行数 阅读全文
posted @ 2023-05-23 14:06 鞋带松了 阅读(2752) 评论(0) 推荐(0) 编辑
摘要: 目录删除 要删除目录,请使用 Dir.rmdir。 但是,与命令 rmdir 一样,此方法只能删除空目录。 Dir.rmdir("dir") 因此,如果不递归删除内容,则无法删除包含内容的目录。 fileutils 库中的 FileUtils.rm_r 会为您完成这项工作。 reqiure 'fil 阅读全文
posted @ 2023-05-23 14:00 鞋带松了 阅读(8) 评论(0) 推荐(0) 编辑
摘要: controller.rb @data = {a: 1, b: 2}@data_new = {"a": 1, "b": 2} index.html var arr = <%= @data %> #=> {:a =>1, :b =>2} var arr = <%= raw @data %> #=> a 阅读全文
posted @ 2023-05-23 13:49 鞋带松了 阅读(14) 评论(0) 推荐(0) 编辑
摘要: Rails在Controller中使用helper方法 view_context.link_to "link", "http://www.baidu.com" or ActionController::Base.helpers.link_to "link", "http://www.baidu.co 阅读全文
posted @ 2023-05-23 13:36 鞋带松了 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 1.获取两个日期之间的月份和年份的唯一数组 require 'date' def doit(first, last) first = first << 1 (12*last.year + last.month - 12*first.year - first.month + 1). times.map 阅读全文
posted @ 2023-05-23 13:30 鞋带松了 阅读(69) 评论(0) 推荐(0) 编辑
摘要: ###在Rails 3中,您可以执行以下操作:Rails.application.routes.recognize_path "/accounts/1" # {:action=>"show", :controller=>"accounts", :id=>"1"} ### 默认method => ge 阅读全文
posted @ 2023-05-23 13:14 鞋带松了 阅读(13) 评论(0) 推荐(0) 编辑
摘要: #Defining formats float_format = Spreadsheet::Format.new :number_format => "#,##0" percent_format = Spreadsheet::Format.new :number_format => "0.00%" 阅读全文
posted @ 2023-05-23 11:02 鞋带松了 阅读(9) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 8 下一页
点击右上角即可分享
微信分享提示