摘要: 1.时间扩展方法: beginning_of_day,end_of_day等等 Time.now.end_of_day 2.ruby类型判断 is_a?(类型) 如:b.is_a?(Array) 阅读全文
posted @ 2017-05-23 11:30 zhuxian300c 阅读(152) 评论(0) 推荐(0)
摘要: 1.生成安全的base64字符串 key = SecureRandom.urlsafe_base64 阅读全文
posted @ 2017-05-19 11:47 zhuxian300c 阅读(329) 评论(0) 推荐(0)
摘要: If you’re just learning Ruby on Rails, you may be confused as to when to generate individual models, resources or scaffolding, and what files are crea 阅读全文
posted @ 2017-05-18 10:47 zhuxian300c 阅读(346) 评论(0) 推荐(0)
摘要: 我们在执行rails g controller controller_name或者rails g model model_name的时候往往会生成相应的assets文件和test,怎么不让rails帮我们生成呢? 在config/application.rb文件中增加下面的代码,其实就是对rails 阅读全文
posted @ 2017-05-17 10:36 zhuxian300c 阅读(283) 评论(0) 推荐(0)
摘要: Delegate是一种应用composite来代替extend的机制,可以有效地降低代码的耦合性。 Rails 2.2增加了delegate方法,可以十分方便地实现delegate机制。 delegate方法首先检查传入的参数,正确参数形式为:method1, :method2, ..., :met 阅读全文
posted @ 2017-05-12 16:40 zhuxian300c 阅读(425) 评论(0) 推荐(0)
摘要: React Router V4 正式版发布,该版本相较于前面三个版本有根本性变化,遵循 Just Component 的 API 设计理念。 本次升级的主要变更有: 声明式 Declarative 可组合 Composability 声明式 Declarative 可组合 Composability 阅读全文
posted @ 2017-05-08 18:06 zhuxian300c 阅读(171) 评论(0) 推荐(0)
摘要: http://www.cnblogs.com/wonyun/p/5930333.html 阅读全文
posted @ 2017-05-05 12:52 zhuxian300c 阅读(105) 评论(0) 推荐(0)
摘要: fetch api是被设计用来替换XmlHttpRequest的,详细用法如下: http://javascript.ruanyifeng.com/bom/ajax.html#toc27 阅读全文
posted @ 2017-05-04 11:47 zhuxian300c 阅读(146) 评论(0) 推荐(0)
摘要: # map 针对每个element进行变换并返回整个修改后的数组 def map_method arr1 = ["name2", "class2"] arr1.map {|num| num + "and"} print "map ====",arr1, "\n" end def map1_method arr1 = ["name2", "class2"] arr1.map! ... 阅读全文
posted @ 2017-04-26 10:07 zhuxian300c 阅读(474) 评论(0) 推荐(0)
摘要: Package Control Messages Theme - Spacegray Thanks for installing Spacegray! How to activate Activate the UI theme and color scheme by modifying your u 阅读全文
posted @ 2017-04-21 09:21 zhuxian300c 阅读(228) 评论(0) 推荐(0)