随笔分类 -  ruby

摘要:By encapsulating all the logic for an object, whether it’s a Dog or a User or an IceCreamShop, you are able to keep all of the logic and responsibilit 阅读全文
posted @ 2016-05-01 15:02 冰凌花花~ 阅读(143) 评论(0) 推荐(0)
摘要:Dogs have many shared characteristics, like the abilities to wag their tails and drink water from a bowl, but they also have information about them th 阅读全文
posted @ 2016-05-01 14:16 冰凌花花~ 阅读(203) 评论(0) 推荐(0)
摘要:While Ruby’s each method is useful, it also comes with an awesome extended family of methods that are even more powerful! For the next few examples, w 阅读全文
posted @ 2016-04-30 17:22 冰凌花花~ 阅读(207) 评论(0) 推荐(0)
摘要:http://ruby-doc.org/core-2.2.0/Array.html#method-i-compact compact → new_aryclick to toggle source Returns a copy of self with all nil elements remove 阅读全文
posted @ 2016-04-25 17:48 冰凌花花~ 阅读(156) 评论(0) 推荐(0)
摘要:http://docs.ruby-lang.org/en/2.0.0/Hash.html 阅读全文
posted @ 2016-04-25 17:43 冰凌花花~ 阅读(298) 评论(0) 推荐(0)
摘要:https://github.com/rbenv/rbenv#installation 安装ruby的第三步 Run ~/.rbenv/bin/rbenv init for shell-specific instructions on how to initialize rbenv to enabl 阅读全文
posted @ 2016-03-04 14:03 冰凌花花~ 阅读(997) 评论(0) 推荐(0)
摘要:Grape,为API设计而生DSL(Domain Specified Language),官网地址: http://intridea.github.io/grapehttp://intridea.github.io/grape/docs/index.html(1)描述性的API构建方式,代码可读性非... 阅读全文
posted @ 2015-10-08 16:20 冰凌花花~ 阅读(179) 评论(0) 推荐(0)
摘要:ruby on rails 项目如何添加微信分享的功能 阅读全文
posted @ 2015-09-15 18:56 冰凌花花~ 阅读(458) 评论(0) 推荐(0)
摘要:今天调试一个现有项目报错,[Faraday::ConnectionFailed] Connection refused - connect(2) {:host=>"localhost", :port=>"9200", :protocol=>"http"}Connection refused - co... 阅读全文
posted @ 2015-09-11 11:45 冰凌花花~ 阅读(309) 评论(0) 推荐(0)
摘要:一个rails项目如何连多个mongo数据库呢,答案在这里http://stackoverflow.com/questions/16400458/connecting-to-two-databases-mongoid(1)先在config/mongoid.yml配置一下development: s... 阅读全文
posted @ 2015-09-10 16:41 冰凌花花~ 阅读(177) 评论(0) 推荐(0)
摘要:http://guides.rubyonrails.org/ 仔细读一下手册里的关于cache的相关部分,注意一句话:This flag is normally set in the correspondingconfig/environments/*.rband caching is disab... 阅读全文
posted @ 2015-04-14 16:47 冰凌花花~ 阅读(202) 评论(0) 推荐(0)
摘要:form_tag(url_for_options = {}, options = {}, *parameters_for_url, &block)Starts a form tag that points the action to an url configured with url_for_op... 阅读全文
posted @ 2014-10-22 11:52 冰凌花花~ 阅读(272) 评论(0) 推荐(0)
摘要:https://rubygems.org/今天看到了如下的提示:Warning: You're using Rubygems 1.8.23.2 with Spring. Upgrate to at least Rubygems 2.1.0 and run Rails 4.1.4$gem update... 阅读全文
posted @ 2014-09-02 15:08 冰凌花花~ 阅读(216) 评论(0) 推荐(0)
摘要:http://www.ruby-doc.org/stdlib-1.9.3/libdoc/securerandom/rdoc/SecureRandom.html(1)base64(n=nil)::base64generates a random base64 string.The argumentns... 阅读全文
posted @ 2014-09-01 10:49 冰凌花花~ 阅读(1022) 评论(0) 推荐(0)
摘要:https://github.com/rest-client/rest-clienthttps://github.com/jnunemaker/httpartyhttp://ruby-doc.org/stdlib-2.1.2/libdoc/net/http/rdoc/Net/HTTP.htmlhtt... 阅读全文
posted @ 2014-07-18 20:48 冰凌花花~ 阅读(515) 评论(0) 推荐(0)