随笔分类 - 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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:http://docs.ruby-lang.org/en/2.0.0/Hash.html
阅读全文
摘要:https://github.com/rbenv/rbenv#installation 安装ruby的第三步 Run ~/.rbenv/bin/rbenv init for shell-specific instructions on how to initialize rbenv to enabl
阅读全文
摘要:Grape,为API设计而生DSL(Domain Specified Language),官网地址: http://intridea.github.io/grapehttp://intridea.github.io/grape/docs/index.html(1)描述性的API构建方式,代码可读性非...
阅读全文
摘要:ruby on rails 项目如何添加微信分享的功能
阅读全文
摘要:今天调试一个现有项目报错,[Faraday::ConnectionFailed] Connection refused - connect(2) {:host=>"localhost", :port=>"9200", :protocol=>"http"}Connection refused - co...
阅读全文
摘要:一个rails项目如何连多个mongo数据库呢,答案在这里http://stackoverflow.com/questions/16400458/connecting-to-two-databases-mongoid(1)先在config/mongoid.yml配置一下development: s...
阅读全文
摘要:http://guides.rubyonrails.org/ 仔细读一下手册里的关于cache的相关部分,注意一句话:This flag is normally set in the correspondingconfig/environments/*.rband caching is disab...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文

浙公网安备 33010602011771号