0
我正在学习嵌套资源,并在尝试编辑事件时遇到以下错误。事件资源嵌套在用户资源下。有小费吗?如何编辑涉及嵌套资源的位置?
ActiveRecord::RecordNotFound:
Couldn't find Event with id=133 [WHERE "user_events"."user_id" = $1]
# ./app/controllers/events_controller.rb:32:in `edit'
# ./spec/features/user_edits_reg_info.rb:69:in `block (2 levels) in <top (required)>'
活动控制器
def edit
@event = current_user.events.find(params[:id])
end
这也不能工作。当我运行我的测试创建事件时,他们正确地关联,我希望这意味着它是真实的。 – John