【报错记录】NoMethodError in Admin::Jobs#index打错字

Published on:

错误信息:

NoMethodError in Admin::Jobs#index
Showing /Users/apple/job-listing/004/app/views/admin/jobs/index.html.erb where line #8 raised:

undefined method `each' for nil:NilClass
Extracted source (around line #8):

<table class="table table-boldered">
  <% @jobs.each do |job| %>
    <tr>
      <td>
        <%= link_to(job.title, admin_job_path(job)) %>

位置+问题描述:

招聘网站第6-2章,http://localhost:3000/admin/jobs
前台页面没问题,进入后台admin的index页报错

错误排除方法:

排查controller定义的index或对应的view。


Comments

comments powered by Disqus