I’m not even sure how this broke. And I don’t really know what the error means either. It was working previously.
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.to_sym
Extracted source (around line #3):
1: <div id="probes">
2: <h1>Edit Probes</h1>
3: <% form_for @probe do |f| %>
4: <%= f.error_messages %>
5: <p>
6: <%= f.label "Site name" %><br />
The controller:
def edit
@probe = Probe.find(params[:id])
end
This is also happening on the index action
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.to_sym
10: <% for probe in @probes %>
11: <tr>
12: <td class="detail" style="padding-left: 100px;" width="50%">
13: <%=h link_to probe.name, probe %>
14: </td>
15: <td class="detail" style="padding-left: 30px;" width="30%">
16: <%=h @status[x] %>
The controller:
@probes = @current_user.probes.find_existing_probes_for_user
@status_dump = []
for probe in @probes
@status_dump << probe.status
end
@status = []
for id in @status_dump
case id
when 0 then @status << ....
when 1 then @status << ....
when 2 then @status << ....
when 3 then @status << ....
end
end
The find is coming back with data, I’m using ruby debugger.
EDIT
For the index action, it has to do with the probe in the link to.
EDIT 2
I changed probe to edit_probe_path(probe.id) and that works. I’m still not sure why the edit page is still not working.
This had to do with how my links were setup. After messing with them, it seems to have fixed the issue.