當我訪問我的procedure_list觀點我得到這個錯誤:未定義的方法`編碼」的零:NilClass模糊錯誤:未定義的方法編碼爲零:NilClass?
顯然,錯誤的來源是12行,這是第一個的link_to方法:
<table class="table">
<thead>
<tr>
<th>List of Procedures</th>
</tr>
</thead>
<tbody>
<tr>
<td><%= link_to "Service 1", pro_show_path(@code => 99281) %></td>
<td><%= link_to "Service 2", pro_show_path(@code => 99282) %></td>
<td><%= link_to "Service 3", pro_show_path(@code => 99283) %></td>
</tr>
</tbody>
</table>
這裏是我的控制器操作:
def pro_show
@procedures = Procedure.where(:code => @code)
end
一切看起來都還好me..not知道我做錯了..
您的堆棧跟蹤將指出您發生錯誤的確切位置 - 請包括它。 –
你已經提出了[同樣的問題昨天](http://stackoverflow.com/questions/32763008/how-to-assign-a-variable-as-a-route-parameter-in-rails)? – Vucko
我認爲這個問題的答案奏效了,但現在它拋出了錯誤信息。 – hey