Controller 代码
class CveController < ApplicationController
def index
@cves = Cve.all
end
def show
@cve = Cve.find_by(cve_id: params[:cve_id])
end
end
异常信息
Showing app/views/cve/index.html.erb where line #3 raised:
no implicit conversion of nil into String
Extracted source (around line #3):
<h1>Cve#index</h1>
<p>Find me in app/views/cve/index.html.erb</p>
<% @cves.each do |cve| %>
<tr>
<td><%= cve.cve_id %></td>
<td><%= cve.summary %></td>
Rails.root: /Users/admin/RubyProjects/xx-api
Application Trace | Framework Trace | Full Trace
app/views/cve/index.html.erb:3
Request
Parameters:
None
Toggle session dump
Toggle env dump
Response
Headers:
None
class CveController < ApplicationController
def index
@cves = Cve.all
end
def show
@cve = Cve.find_by(cve_id: params[:cve_id])
end
end
异常信息
Showing app/views/cve/index.html.erb where line #3 raised:
no implicit conversion of nil into String
Extracted source (around line #3):
<h1>Cve#index</h1>
<p>Find me in app/views/cve/index.html.erb</p>
<% @cves.each do |cve| %>
<tr>
<td><%= cve.cve_id %></td>
<td><%= cve.summary %></td>
Rails.root: /Users/admin/RubyProjects/xx-api
Application Trace | Framework Trace | Full Trace
app/views/cve/index.html.erb:3
Request
Parameters:
None
Toggle session dump
Toggle env dump
Response
Headers:
None