elixir - KeyError in Phoenix web framework -
elixir - KeyError in Phoenix web framework -
i next error in client when trying serve page client:
(keyerror) key :id not found in: %phtest.jobs{"@class": "job", "@rid": "#13:0", "@type": "d", "@version": 1, description: "öoisajdf sadöflkjasdfö lkj", job_status: "open", job_type: "developer", title: "foo"} stacktrace
(phtest) web/templates/page/index.html.eex:27: phtest.pageview."-index.html/1-lc$^0/1-0-"/1 (phtest) web/templates/page/index.html.eex:16: phtest.pageview."index.html"/1 ...
it working before i've modified model switching out job.id
job."@rid"
. template looks this:
<ul class="list-unstyled" style=""> <%= job <- @jobs %> <li class="job-list"> <div class="row"> <div class="col-md-9"> <a href="/jobs/<%= job."@rid" %>"> <span class="title"><%= job.title %></span> <span class="label label-success"><%= job.job_type %></span> <span class="label label-default"><%= job.job_status %></span> </a> </div> <div class="col-md-3 buttons" style="text-align: right"> <!-- <form method="post" action="<%= job_path(:destroy, job.id) %>"> --> <a href="/jobs/<%= job."@rid" %>/edit" class="btn btn-warning btn-sm"> edit</a> <a href="/jobs/<%= job."@rid" %>?action=delete" class="btn btn-default btn-sm"> delete</a> <!-- <input type="hidden" name="_method" value="delete"> <button type="submit" class="btn btn-default btn-sm">delete</button> --> </div> </div> </li> <% end %> </ul>
the first line of stack trace shows error in template.
the template in turn still referring old job.id
still beingness evaluated despite beingness within html comment brackets. either right job."@rid"
, remove code exclusively or comment out eex template code this:
<!-- <form method="post" action="<%= #job_path(:destroy, job.id) %>"> -->
elixir phoenix-framework
Comments
Post a Comment