main的未定义方法:通过定义方法的对象(NoMethodError)

时间:2015-07-01 21:52:15

标签: ruby

我已使用以下代码段定义了一个脚本:

check_params param

def check_params(param)
 # some code
end

当我跑步时,我得到了

  

主要的未定义方法`check_params':对象(NoMethodError)

1 个答案:

答案 0 :(得分:14)

Ruby希望在调用方法之前声明方法,在调用方法之前尝试移动方法定义:

.clearfix:before, .clearfix:after {content: " "; display: table;}
.clearfix:after {clear: both;}
.clearfix { *zoom: 1;}

.large-icon-list {
    margin-top: 5em; border-bottom: 1px solid #eee;
    margin-left: 8.54701%; margin-right: 8.54701%;
}

.large-icon-list li {
    min-height: 170px; width: 48.71795%;
    float: left; margin-right: 2.5641%;
    display: inline;
}

/* one class-rule for each image - here sheets */
.large-icon-list li.icon-list-sheets .icon-list-image {
  background: url("../icon-sheets.png?14....9") 
  no-repeat top center;
}

.large-icon-list li .icon-list-image {
  height: 100px; width: 23.07692%;
  float: left; margin-right: 2.5641%;
  display: inline;
}

.large-icon-list li .icon-list-content {
  width: 74.35897%; float: right;
  margin-right: 0; *margin-left: -30px;
  display: inline;
}