【发布时间】:2012-06-03 06:56:56
【问题描述】:
这很奇怪,我在我的 rails 应用程序上运行bundle exec guard,并且在一个单独的容器中的每个操作都得到一长串错误。所有的错误都是完全相同的,没有任何意义,这就是我对所有操作的结果:
1) PriceProfilesController GET index assigns all price_profiles as @price_profiles
Failure/Error: Unable to find matching line from backtrace
ArgumentError:
wrong number of arguments (1 for 0)
# ./app/controllers/price_profiles_controller.rb:15:in `extend'
2) PriceProfilesController GET show assigns the requested price_profile as @price_profile
Failure/Error: Unable to find matching line from backtrace
ArgumentError:
wrong number of arguments (1 for 0)
# ./app/controllers/price_profiles_controller.rb:15:in `extend'
... and so forth
知道发生了什么吗? PriceProfileContainer 几乎是一个标准的脚手架。我应该在哪里看这里。规范文件由脚手架自动生成。
更新----
这是我的控制器代码中的扩展功能:
# GET /price_profiles/1/extend
def extend
@price_profile = PriceProfile.find(params[:id])
@products = Product.all()
@locations = Location.all()
@price_profile_date_range = PriceProfileDateRange.new()
#respond_to do |format|
# format.html # extend.html.erb
#end
end
差不多了。
【问题讨论】:
-
我认为您需要发布您的控制器代码。根据该错误,您似乎在
price_profiles_controller中调用了第 15 行的 extend 方法并将其传递给它不期望的参数。但需要查看代码才能确定。 -
@GeoffLanotte 嗨,请查看我的更新
标签: ruby-on-rails-3 rspec tdd