我似乎無法弄清current_user
顯示,編輯和銷燬鏈接的正確路徑。當前用戶編輯並銷燬路徑
這是我曾嘗試:
<% current_user.tasks.each do |task| %>
<tr>
<td><%= task.completed %></td>
<td><%= task.description %></td>
<td><%= link_to 'Show', task %></td>
<td><%= link_to 'Edit', edit_current_user_task_path(task) %></td>
<td><%= link_to 'Destroy', task, method: :delete, data: { confirm: 'Are you sure?' } </td>
</tr>
<% end %>
任何想法?
謝謝,請收到此錯誤 未定義的方法'edit_user_task_path」 – Joshua
您是否嘗試過運行'耙routes'?你對編輯任務路徑有什麼看法? – mmichael
似乎現在工作,似乎是我的道路上的一個錯誤,我確實道歉。 – Joshua