首页 > 解决方案 > 课程中的 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"}

标签: ruby-on-rails

解决方案


推荐阅读