获取“未定义方法”黄瓜中的表单选择错误
我正在尝试使用黄瓜访问一个页面:
visit new_video_path
但我收到此错误:
undefined method `episode_id' for #<Video:0x22df8dc> (ActionView::TemplateError)
On line #19 of app/views/videos/_form.html.erb
...
19: <%= select(:video, :episode_id, @episodes.collect {|e| [ e.title, e.id ] }, { :include_blank => true }) %>
它在浏览器中加载良好,并且表单处理也很好。
我做错了什么?
I'm trying to visit a page with cucumber, with:
visit new_video_path
but I get this error:
undefined method `episode_id' for #<Video:0x22df8dc> (ActionView::TemplateError)
On line #19 of app/views/videos/_form.html.erb
...
19: <%= select(:video, :episode_id, @episodes.collect {|e| [ e.title, e.id ] }, { :include_blank => true }) %>
It loads fine in the browser, and the form processes fine too.
What did I do wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
啊,发现问题了。我忘记迁移测试数据库。
Ah, found the problem. I forgot to migrate the test database.