这很奇怪,我在我的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几乎是一个标准的脚手架。我应该在哪里看这里。规范文件由脚手架自动生成。
更新----
这是我的控制器代码中的Extend函数:
# 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
几乎就是这样。
答案 0 :(得分:3)
extend
是一个核心ruby方法,允许您将模块的方法添加到对象(有点像include)
最简单的方法是为您的方法选择一个不同的名称