ruby-on-rails - 课程中的 ActionController::UrlGenerationError#index
问题描述
没有路线匹配 {:action=>"show", :controller=>"lessons", :course_id=>"1", :id=>nil, :section_id=>"1"},缺少必需的键:[:id ] 提取的源代码(大约第 19 行):
<div class="lesson-link">
<%= link_to "show", course_section_lesson_path(lesson, @section, @course) %>
</div>
<% end %>
Rails.root:/home/kihara/classrooom11
应用程序跟踪 | 框架跟踪 | 完整跟踪 app/views/lessons/index.html.erb:19 app/views/lessons/index.html.erb:10 请求参数:
{"course_id"=>"1", "section_id"=>"1"}
解决方案
推荐阅读
- python - 在做 scipy.signal.spectrogram 时,我怎么知道会有多少时间段?
- r - 根据两列中的数据转置数据框中的值
- mysql - 无法在 Ubuntu 18.04.4 LTS 中安装 MySQL
- c# - Xamarin 表单 - 网址未在 Webview 中显示
- varnish - 如何以 varnishncsa 客户端模式日志格式记录后端?
- html - 如何在不匹配属性名称的情况下在选择中使用对象子作为值
- c# - 将二进制文件从 MemoryStream 保存到网络路径会间歇性地保存 0 字节文件
- c++ - 多线程 UDP 服务器中 io_context 或 std::cout 的奇怪行为
- python - 如何在 Kivy 中使用创建圆形或圆形按钮。Kv 和不使用。.kv 文件
- c# - 如何在弹出窗口中单击按钮?(木偶锋利)