ruby 代码
require 'net/http'
Net::HTTP.start('open2ye.javaeye.com', 80) do |http|
response = http.get('/')
#Do some ...
xml 代码
<html>
<head>
<title>Ext lession 2 - Element selecttitle>
<link rel="stylesheet" type="text/css" href="http://www.agideo.com/lib/ext-1.0-al ...
xml 代码
<html>
<head>
<title>Ext lession 1 - heat class Elementtitle>
<link rel="stylesheet" type="text/css" href="http://w ...
ruby 代码
assert_raise(ActiveRecord::RecordNotFound) { # 注意:这个括句一定要在一行
# xxxx
}
好的编程习惯可以让你少走很多弯路.
irb
ruby 代码
arr = [1,2,3]
arr.size -1
会报 ArgumentError
原因:
arr.size 是一个方法
Ruby 认为 -1 是参数,而不是减1
正确应该是
ruby 代码
arr.size - 1
- 浏览: 9973 次
- 性别:

- 来自: 温州

- 详细资料
搜索本博客
我的相册
mary.JPG
共 27 张
共 27 张
最近加入圈子
链接
最新评论
-
Ruby Http Client
really?
-- by jerry -
ruby 又一BUG 折磨了我很 ...
放这里记一下sudo apt-get install openssh-clien ...
-- by open2ye -
rails 的测试的 bug 当你 ...
还有一个可能造成这个问题的原因是rails test的transactional ...
-- by iamawalrus -
rails 的测试的 bug 当你 ...
gigix 写道 干嘛不放在before_save呢? 例如Part 在 be ...
-- by open2ye -
rails 的测试的 bug 当你 ...
iamawalrus 写道 检查test环境的db以及对应的table是否和de ...
-- by open2ye






评论排行榜