我在worequests模型範圍:Rails的範圍試驗鑑於
scope :notcompl, where("statuscode_id != ?", Statuscode.last.id)
我想只顯示在worequests的編輯按鈕顯示頁面,如果worequest是notcompl。我試過這個,並得到了未定義的方法:
<% if @worequest.notcompl? %>
<= link_to 'Edit', edit_worequest_path(@worequest), :class => 'btn btn-success' %>
<% end %>
什麼是正確的語法?
感謝您的幫助!
我也試過@ worequest.notcompl – Reddirt 2013-04-30 14:17:27
謝謝 - def工作! – Reddirt 2013-04-30 14:22:40